As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
My requirement is to produce multiple Excel tabs.If there are no records in one particular tab I should display "There are no records".
SET COMPOUND=OPEN
TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ '2';
ON TABLE PCHOLD FORMAT EXL2K
END
-IF &LINES EQ 0 THEN GOTO TABLE1 ELSE GOTO OTHERS;
-TABLE1
TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END
-OTHERS
SET COMPOUND=CLOSE
TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ '6';
ON TABLE PCHOLD FORMAT EXL2K
END
-IF &LINES EQ 0 THEN GOTO TABLE2 ELSE GOTO OTHERS1;
-TABLE2
TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END
-OTHERS1
-EXIT
Here is my code.If the first report(tab) has zero records, the message is being displayed correctly.But for the second tab,if there are zero records I don't see the second tab with the messagae.I am not sure why this is happening.where am I going wrong.Could some one help me.
ThanksThis message has been edited. Last edited by: Kerry,
Because it's a compound report, the second report closes the compound report, even though there's no data. Here is one solution - create a compound report with a dummy last report:
SET COMPOUND=OPEN
-RUN
TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ 2;
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-IF &LINES EQ 0 THEN GOTO TABLE1 ELSE GOTO OTHERS;
-TABLE1
TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-OTHERS
TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ 6;
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-IF &LINES EQ 0 THEN GOTO TABLE2 ELSE GOTO OTHERS1;
-TABLE2
TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-OTHERS1
SET COMPOUND=CLOSE
-RUN
TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ 999;
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-EXIT
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Another possible way is to add this to the top of your report
SET EMPTYREPORT = ANSI
Although it will not say "There are no records" it will just not have any data rows but keeps everything else (heading, footing, and column titles). If that would be okay for your requirement instead.
TABLE FILE CAR PRINT SEATS WHERE SEATS EQ '2'; ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Report 1',$ ENDSTYLE END
TABLE FILE CAR PRINT SEATS NOPRINT HEADING "There are no records" ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Empty 1',$ ENDSTYLE END
TABLE FILE CAR PRINT SEATS WHERE SEATS EQ '6'; ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Report 2',$ ENDSTYLE END
SET COMPOUND=CLOSE
TABLE FILE CAR PRINT SEATS NOPRINT HEADING "There are no records" ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Empty 2',$ ENDSTYLE END