October 05, 2006, 09:56 AM
<Sengott>thanks
October 05, 2006, 10:02 AM
FliPPeRWhat I do is force an "empty" report using table CAR with a message in my title... That way you create a report, no matter which output (EXL2K, HTML, PDF, ...) but it's just an error message.
In my report I set &TITLE2 to '', but in case my report is empty, I set it to a message. &TITLE 2 is included in my heading all the time.
You check if your last TABLE FILE returns lines and if no, you goto this procedure:
-IF &LINES EQ 0 THEN GOTO FINISH;
...
-FINISH
SET EMPTYREPORT = ON
-SET &TITLE2 = '*** Sorry there is no data for your selections ***';
TABLE FILE CAR
PRINT CAR NOPRINT
BY COUNTRY NOPRINT
WHERE CAR EQ 'NODATA';
-GOTO STYLE;
STYLE is the style sheet part of code used for both the empty report and real one (HEADING, FOOTING, STYLE, etc...).
ex:
-STYLE
HEADING
"&TITLE"
"&TITLE2"
" "
FOOTING
"Page
"&TITLE&TECHNAME"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT '&WFFMT.(HTML,EXL2K,PDF).Display Output.'
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
...
END
I hope it helped you.
October 05, 2006, 10:58 AM
susannahor..
-IF &LINES GT 0 GOTO repgen;
-HTMLFORM BEGIN
<html>
<table><tr><td>
no data ...
</td></td></table>
</html>
-HTMLFORM END
-EXIT (or GOTO eoj.thisfex;)
-repgen
..write your report here