Focal Point
[SOLVED] Handling a report with no records

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2277063196

June 13, 2019, 11:35 AM
ccollier
[SOLVED] Handling a report with no records
I have a report that sometimes may generate records, and other times return nothing. The default page that shows up isn't the greatest, so I decided to create an HTML page if there aren't any records. Here's my current code:

 TABLE FILE sp_soft_hard_fail_list
PRINT SOURCE_SYSTEM AS 'Source System'
      FULL_TABLE AS ''
END

-IF &RECORDS EQ 0 THEN GOTO ERROR

-ERROR
-HTMLFORM BEGIN
<html>
<body>
<p>Test</p>
</body>

</html>

-HTMLFORM END 


The only problem is, even when I'm recieving records from the table the paragraph still appears at the very end of the report. I have tried to check &LINES as well, but that doesn't do anything either

This message has been edited. Last edited by: ccollier,


WebFOCUS 8.2.01M on Windows 10
June 13, 2019, 11:37 AM
BabakNYC
Change your IF &RECORDS GOTO to skip the ERROR.

 
-IF &RECORDS NE 0 THEN GOTO SKIP

-HTMLFORM BEGIN
<html>
<body>
<p>Test</p>
</body>

</html>

-HTMLFORM END  

-SKIP



WebFOCUS 8206, Unix, Windows
June 13, 2019, 11:48 AM
ccollier
That was extremely easy. Thanks, I guess I'm just not with it today Sweating


WebFOCUS 8.2.01M on Windows 10