Focal Point
[CLOSED] Empty report ON

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

January 07, 2020, 05:15 AM
iampg
[CLOSED] Empty report ON
Hi Team - New year greetings to all

I was checking on empty report and with SET EMPTYREPORT = ON i am not receiving blank report for report format COMT, where as it is working for EXL2K

EMPTYREPORT = ON doesn't work for COMT ?

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 7.7
Unix
All Formats : Excel,PDF,HTML,Dlimiter,.txt
January 07, 2020, 08:02 AM
MartinY
Basically, COMT is not a "report" but a data file output format. So, no it's not working as you thing it will.

Regarding Excel output format, as per : Controlling Output When a TABLE Request Retrieves Zero Records you have an empty Excel file because EMPTYREPORT is not supported for this action

But using the below, I do have an empty (0 bytes) csv file generated
TABLE FILE CAR
PRINT SEATS
BY COUNTRY
BY CAR
WHERE COUNTRY EQ 'CANADA';
ON TABLE HOLD AS baseapp/TEST FORMAT COMT
END
-RUN



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
January 07, 2020, 04:31 PM
Doug
Use a pre-process to check to see if you have data that will/will not be held as COMT and branch accordingly.
-SET &ECHO = ALL ;
TABLE FILE CAR
PRINT SEATS
WHERE RECORDLIMIT EQ 1;
-*WHERE COUNTRY NE COUNTRY ;
ON TABLE HOLD 
END
-RUN
-IF &RECORDS EQ 0 THEN GOTO :NoDataToHold ELSE GOTO :HoldThis ;
-:HoldThis
TABLE FILE CAR
PRINT SEATS
BY COUNTRY
BY CAR
ON TABLE PCHOLD AS baseapp/TEST FORMAT COMT
END
-RUN
-GOTO :TheEnd

-:NoDataToHold
SET EMPTYREPORT = ON
SET PAGE = NOPAGE
TABLE FILE CAR
HEADING
"NO DATA FOR THIS REPORT"
PRINT SEATS NOPRINT
WHERE COUNTRY NE COUNTRY ;
ON TABLE PCHOLD FORMAT HTML
END
-RUN
-GOTO :TheEnd

-:TheEnd
-SET &ECHO = OFF ;
-TYPE *** The End ***
-EXIT





   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
January 10, 2020, 06:31 AM
iampg
Thank you Martin and Doug for the reply!

I tried both the way and i don't see empty report getting generated.

In schedule if i select EXL2k as report format and run i receive empty report but when i select COMT and run the schedule,log is showing "no report to distribute"


WebFOCUS 7.7
Unix
All Formats : Excel,PDF,HTML,Dlimiter,.txt
January 10, 2020, 07:19 AM
MartinY
As I stated, COMT is NOT a report format, it's a file format and RC expect to produce a report, not a file. Its name tell it "REPORT Caster".
We can generate file with RC but at the end, if you are not "giving" him a report it will send you that warning.
Try the following code and setting

1- Create a fex with the below and add it in a schedule
TABLE FILE CAR
PRINT SEATS
BY COUNTRY
BY CAR
WHERE COUNTRY EQ 'CANADA';
ON TABLE HOLD AS baseapp/TEST FORMAT COMT
END
-RUN

-* --------------------------------------------------
-* THIS STEP IS ONLY TO AVOID THE RC WARNING FROM NO REPORT TO DISTRIBUTE
-* --------------------------------------------------
TABLE FILE CAR
BY COUNTRY NOPRINT
HEADING
" END OF : GENERATES COMT TEST FILE"
WHERE READLIMIT   EQ 1;
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET PAGE NOLEAD
ON TABLE SET HTMLCSS ON
END
-RUN

2- In your schedule in the Distributions tab add a "Report Library" as the distribution method
3- Run the schedule

It will result in TEST.csv empty file generated under baseapp and you RC log file will not have the "No report to distribute"


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