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.
Originally posted by rstull: [qb] I am in the process of adding empty report logic to some reports. Can I customize the message when there is no data to display? If so, how?
Originally posted by rstull: [qb] I am in the process of adding empty report logic to some reports. Can I customize the message when there is no data to display? If so, how?
Thanks! [/qb]
Oops. Sorry about that. I tried to post some HTML code after testing -IF &LINES EQ 0 GOTO ERRMSG, but it was rejected by the forum. Tom
TABLE FILE CAR SUM SALES BY COUNTRY WHERE COUNTRY CONTAINS '&CTRY' ON TABLE HOLD END -RUN -**************************************************************** -* If empty report then display message and exit, -* else display the report. -**************************************************************** -IF &RECORDS EQ 0 THEN GOTO :EMPTYRPT ELSE GOTO :DISPREPORT; -:EMPTYRPT -SET &MESSAGE='No data found for COUNTRY containing text: ' | &CTRY; -HTMLFORM BEGIN
&MESSAGE
-HTMLFORM END -GOTO :ENDREPORT; -* -:DISPREPORT TABLE FILE HOLD PRINT * END -GOTO :ENDREPORT; -* -:ENDREPORT
There are plenty of possible modifications of the method. For instance, you can -INCLUDE your "empty report message" page, instead of embedding HTML into FEX - this way you can reuse your "empty report message" page. etc., etc., ... See also how it is solved within the CenturyCorp demo code. (e.g. salerank.fex)
Hope this helps GrzegorzThis message has been edited. Last edited by: <Maryellen>,
I tried that initially. But, several of the end users thought since the headings loaded, that there was more data to be displayed. I had the same result with setting it to off. The users thought the page was just loading slowly. My hope, with adding a message, is to clarify the situation for the end user.
ah, i see. here's what i do: you could create a line in your heading, say line 2. it is populated by an &var and the &var is defaulted to empty -SET &HEADLINE2 = ' ' ; now, at the end of your fex, -SET &HEADLINE2 = IF &LINES GT 0 THEN ' ' ELSE 'NOPE NO DATA FOR YOU TODAY'; then in your fex HEADING " STUFF" " &HEADLINE2 "
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
SET EMPTYREPORT=ON -SET &EmptyHead = ' '; TABLE FILE CAR PRINT BODYTYPE BY CAR WHERE COUNTRY EQ 'INVALID' ON TABLE HOLD END -RUN -SET &EmptyHead = IF &LINES GT 0 THEN ' ' ELSE 'Sorry, there''s no data today.'; TABLE FILE HOLD HEADING "&EmptyHead" PRINT * ON TABLE SET STYLE * TYPE=HEADING, COLOR=RED,$ ENDSTYLE END
Is there a way to do this without using a hold file? Thanks, Michael
This code came out of an old WebFocus Users Manual.... still seemed to work....
TABLE FILE CAR HEADING " " PRINT SEATS DEALER_COST RETAIL_COST WARRANTY BY CAR WHERE COUNTRY EQ 'INVALID' END -RUN -IF &LINES EQ 0 GOTO RPT2 ELSE GOTO REPTDONE; -RPT2 -TYPE NO REPORT INFORMATION GENERATED -RUN -QUIT -REPTDONE -EXIT
Posts: 132 | Location: Kansas | Registered: November 12, 2003
Another option if you want to drop the message into a 'jacket' program that has the same look and feel is to do something along the following lines:
TABLE FILE MFDNAME PRINT * ON TABLE HOLD AS JACDAT FORMAT HTML END -IF &LINES EQ 0 GOTO EMPTRPT; -RUN -GOTO JCKT -EMPTRPT TABLE FILE SMALLFILE "No data was found for the criteria entered" PRINT FIELD NOPRINT ON TABLE HOLD AS JACDAT FORMAT HTML END -RUN -JCKT -HTMLFORM JCKTHTML -EXIT
You then have an html file with the phrase !IBI.FIL.JACDAT; at the point in the html file where you want the phrase to appear..
We use this as a way of making the error message look more friendly and you can customize it however you need to. Also keeps the look and feel the same as the report data which would have dropped into that same jacket.
Mikel, yes exactly. you need the &LINES count so i don't see how to get it without creating a holdfile. webfocuspgm, -TYPE won't display html code. rstull, there's probably a typo somewhere in your code. it'll work. just keep tweaking. we're all giving you the same answer, essentially, just different flavors
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
proc ... -IF &LINES EQ 0 THEN GOTO NODATA; END ...
ENDSTYLE END -GOTO DONE -NODATA -INCLUDE ERRORPAGE END
-DONE Then we used the proc for errorpage
-* File ERRORPAGE.fex TABLEF FILE REPORT PRINT Report_ID NOPRINT HEADING "No data was extracted. Review your criteria and submit again"
ON TABLE SET ONLINE-FMT &fmt ON TABLE SET EMPTYREPORT ON ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * UNITS=IN, PAGESIZE=&PSize, LEFTMARGIN=0.250000, RIGHTMARGIN=0.050000, TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, ORIENTATION=LANDSCAPE, $
TYPE=REPORT, ORIENTATION=LANDSCAPE, $
END
Report table was a very small table that we used - create a table with one row of data