Focal Point
HI i have some Problem with &retcode

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

March 06, 2006, 06:59 AM
kalyanswarna
HI i have some Problem with &retcode
Hi ALL
iam working on Graphs with filters
for some filters it shows NO DATA
i want to customise this nodata
i have some idea on &RETCODE but how it works
and where i need to use thids to customize my Procedure.please give me a solution for this problem.

Thanks
March 06, 2006, 07:49 AM
Tony A
If, by NO DATA, you mean that the report has no records to be displayed (as opposed to NULLS) then use &LINES or &RECORDS together with SET EMPTYREPORT = ON to intercept that empty report.

&RECORDS is populated with the number of records returned by the query.
&LINES is populated with the number of lines of output resulting from your BY and verb clause combination. e.g. If you use PRINT field BY another_field then &RECORDS and &LINES will probably be the same, but if you use SUM field BY another_field then &RECORDS will be greater than &LINES.

After your GRAPH or TABLE check the value of &LINES and, when zero, redirect the output to give an empty report on the users terminal. Something like -
GRAPH FILE CAR
SUM RCOST
BY COUNTRY
WHERE COUNTRY EQ 'INDIA'
ON GRAPH SET GRAPHEDIT OFF
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRAPHSTYLE *
setGraphType (17);
ENDSTYLE
END
-RUN

-IF &LINES GT 0 THEN :ShowReport;
-HTMLFORM BEGIN
<html><head><title>Empty Report</title></head>
<body>
<h1>Your report returned no results
</body></html>
-HTMLFORM END
-EXIT

-:ShowReport


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 06, 2006, 09:00 AM
kalyanswarna
Hi Tony
Thanks for Your Quick Reply.

This message has been edited. Last edited by: kalyanswarna,
March 06, 2006, 09:46 AM
<JG>
The easiest way to keep your size is to create an image that contains the NO DATA message.
If you create it with the same size attributes as the graph output that solves your problem.
March 06, 2006, 10:33 AM
Tony A
I agree with JG and it is the method I normally use for a graph when saved as a gif. I keep a copy of a few gifs with both axis', no lines or bars and the words "The request produced no data" plastered across the centre.

I also keep one with "Corrupt file" as the text and this is used when the gif created can not be opened with an image viewer (unrecognised format). To identify when this occurs I read the first 6 characters of the gif file and check for it being equal to "GIF89a" (if I remember correctly). If it isn't that or the &IORETUN is not 0 (no file to be read) then I use the bad image gif.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10