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