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.
There is a couple of ways to do this, but I would suggest checking the &LINES after the TABLE FILE, and if they are zero, show the empty report.
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAG'
END
-RUN
-IF &LINES GT 0 THEN GOTO NEXT_BIT ;
SET EMPTYREPORT = ANSI
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
FOOTING
"no result found "
WHERE CAR EQ 'JAG'
END
-EXIT
-NEXT_BIT
I would also suggest checking out the Dialog MAnager stuff (lines that begin with a dash) and the SET commands. They will help.
You could also try using a DUMMY support field and a conditional SUBFOOT to achieve a similar effect while doing only 1 pass over your data:
-DEFAULT &P_CAR = 'JAG';
SET EMPTYREPORT = ANSI
DEFINE FILE CAR
DUMMY/A1 = 'X';
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
BY DUMMY NOPRINT
ON DUMMY SUBFOOT
"no result found "
WHEN DUMMY NE 'X';
WHERE CAR EQ '&P_CAR'
END
The EMPTYREPORT = ANSI setting indicated by Waz is the key element for either approach to work.
Yes thanks for the reply. Can i achieve this without putting this in the footing?? I come from a jasper report environment and this is extremely easy in that environment
WebFOCUS 7.6.9 Windows all output (Excel, HTML, PDF)
Can you? well ... with more work involved, you could perhaps create a fake record and put it there after you verified that no data was found, but the FOOTING/SUBFOOT is much easier.
The question is ... why don't you want to use a FOOTING/SUBFOOT? What difference does it make to your business users who will be ones consuming the report?
Is the FOOTING at the bottom of the page? Use then a SUBFOOT as I showed above. The message will show up right below the column titles ad well above the actual FOOTING.
-DEFAULT &P_CAR = 'JAG';
SET EMPTYREPORT = ANSI
SET NODATA = ' '
DEFINE FILE CAR
DUMMY/A1 = 'X';
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
BY DUMMY NOPRINT
ON DUMMY SUBFOOT
"no result found "
WHEN DUMMY NE 'X';
WHERE CAR EQ '&P_CAR'
ON TABLE PCHOLD FORMAT PDF
FOOTING BOTTOM
"Run Date: &YYMD"
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAG'
END
-RUN
-IF &LINES GT 0 THEN GOTO NEXT_BIT ;
SET EMPTYREPORT = ANSI
SET NODATA = ' '
DEFINE FILE CAR
DUMMY/A1 = ' ' ;
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
BY DUMMY NOPRINT
ON DUMMY SUBHEAD
"no result found "
WHERE CAR EQ 'JAG'
FOOTING
"Run Date: &YYMD"
END
-EXIT
-NEXT_BIT
And then we have a standard HTML page called SPLASH_ERROR.htm and SPLASH_EMPTY.htm that shows a fancy message with a support contact number in case this is not what the user expects.