Focal Point
[CLOSED] Specify "No Data" when there are no records

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

November 03, 2014, 10:39 AM
GavinL
[CLOSED] Specify "No Data" when there are no records
We have a portal with 9 different reports on it. In the left banner we have an html with controls that allows us to filter, which updates all 9 reports on the screen. If that filter removes all records for one of those reports, we need it to say, "No Data" instead of coming back with a header, blacked out data, and removing the footer.

What is the best way to do that?

This message has been edited. Last edited by: <Kathryn Henning>,



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
November 03, 2014, 11:15 AM
GavinL
I've tried using Tony's way from:
http://forums.informationbuild...1057331/m/1171091461

However, it doesn't seem to do anything. Even after adding it, the report is still only a header with no body and no footer.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
November 03, 2014, 11:17 AM
MartinY
Have you considered doing it like this:
-DEFAULT &CNTRY = 'ITALIA'

TABLE FILE CAR
PRINT MODEL
BY CAR
WHERE COUNTRY EQ '&CNTRY';
ON TABLE HOLD as H1
END

-IF &LINES EQ 0 THEN GOTO NODATA;

TABLE FILE H1
PRINT MODEL
BY CAR
END
-GOTO XEND;

-NODATA
TABLE FILE CAR
BY COUNTRY NOPRINT
WHERE READLIMIT   EQ 1;
WHERE RECORDLIMIT EQ 1;
HEADING
"No Data"
END
-XEND



WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
November 03, 2014, 11:22 AM
GavinL
I'll give it a try and let you know.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
November 03, 2014, 11:38 AM
GavinL
I must be doing something wrong, because by doing this, it always returns no data WF no data error page.

Little more looking at what you got, doesn't this mean, the report will be querying the data twice, so I've just doubled my retrieval time?



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
November 03, 2014, 11:42 AM
Tom Flynn
For a portal, use HTML:
  
-NO_RECORDS
-INCLUDE NO_RECORDS_FOCEXEC
-GOTO EOJ


NO_RECORDS_FOCEXEC
  
-HTMLFORM BEGIN
</br>
[b]There are <FONT color="RED">ZERO</FONT> records generated for the parameter selection(s) </br>
    you have made for this report/process. </br>
Please re-submit the report with a different set of parameter selection(s)... </br>
</br>
Thank you.</br> </br> [/b]
-HTMLFORM END
-*********************




Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 03, 2014, 01:03 PM
GavinL
Thank you. I can't do the include, because I want the headers and everything to stay the same and each report header is different, however I did get something to work. The message is based on your message.

ENDSTYLE
-IF &LINES EQ 0 THEN GOTO NO_RECORDS;
-GOTO EOJ;

-NO_RECORDS
-HTMLFORM BEGIN
<ul>
<b>There are <FONT color="RED">&LINES</FONT> records generated for the parameter selection(s) you have made for this report/process. </br>
</br>
Please re-submit the report with a different set of parameter selection(s)... </br>
</br>
Thank you.</b>
</ul> 
-HTMLFORM END

-EOJ
END
-RUN




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
November 03, 2014, 02:45 PM
Tom Flynn
Don't see how that is working since the syntax is incorrect.
S/B:

-HTMLFORM BEGIN
<ul>
<b>There are <FONT color="RED">!IBI.AMP.LINES;</FONT> records generated for the parameter selection(s) you have made for this report/process. </br>
</br>
Please re-submit the report with a different set of parameter selection(s)... </br>
</br>
Thank you.</b>
</ul>
-HTMLFORM END


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 03, 2014, 02:49 PM
MartinY
To avoid the double DB retrieving time, just hold your data and then use it as I fixed my code in my previous post.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007