Focal Point
[CLOSED]getting NO LINES of data passed through to Excel

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

January 26, 2016, 12:15 PM
MRd
[CLOSED]getting NO LINES of data passed through to Excel
I am currently using Report Castor to run a daily repot that produces an Excel output. The report works find under normal conditions, however, on certain days, if finds that there is no data to report. (No Lines) In these situations, the report crashes, and the end-user assumes that something irregular happened. How can I use &Lines to send a note to the end-user (presumably through Report Castor) that there were NO RECORDS THAT MET THE CRITERIA rather than simply failing. I've notice on some other forums various techniques for outputting friendly HTML messages... but I need to communicate back to the end user either through a 1 line string of text embedded in EXCEL or through Report Castor. Thx. MRd

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus APP Studio (WFAS)
v 8.1.05
MS Windows Server - 32 bit
January 26, 2016, 12:50 PM
BabakNYC
Do you have EMPTYREPORT set to on or off in the report?

Here's one way to accomplish this:
TABLE FILE CAR
PRINT CAR BY COUNTRY
WHERE COUNTRY EQ 'CHINA';
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET EMPTYREPORT OFF
END
-IF &LINES NE 0 GOTO GOT_DATA;
-* the NODATA report
TABLE FILE CAR
HEADING
" Your report is empty. "
PRINT CAR NOPRINT
WHERE RECORDLIMIT EQ 1;
WHERE READLIMIT EQ 1;
END
-RUN
-GOT_DATA

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


WebFOCUS 8206, Unix, Windows