Because I needed a header row in a report and because saving as a text file from WebFocus will not bring the header row to the report I am creating, I created compound report with an output to 'ON TABLE PCHOLD FORMAT ALPHA' so I can download the report and save to a txt file with the header row at the top. Have not found any other output format that will keep the fields in the absolute position needed for the file. It will be used in another application and file layout cannot change.
Long story short, using a compound report, the header is in the report, but I am losing the first row of detail. Anyone else had this problem, and if so, how did you fix?
HEADER RECORD - NO. OF RECS 000071 TIMESTAMP 08-24-2018, 13:20 [FIRST ROW OF DETAIL S/B HERE - MISSING]..... 91341196967640119811630625NPE24AFXHH562755SONATA W000000 ..... 9134119696762011981976612KNMAT2MT2HP560133ROGUE W000000 .....
CODE:
DEFINE FILE FOCTPUL8 LINE1/A150 = 'HEADER RECORD - NO. OF RECS' | ' ' | COUNTER |' ' | ('TIMESTAMP ' | ' ' ) | RUN_DATE; END -******************************************************************************* SET COMPOUND = OPEN -******************************************************************************* TABLE FILE FOCTPUL8 PRINT LINE1 WHERE RECORDLIMIT EQ 1; ON TABLE PCHOLD FORMAT ALPHA END -RUN -******************************************************************************* SET COMPOUND = CLOSE -******************************************************************************* TABLE FILE FOCTPUL8 PRINT (ALL FIELDS ARE LISTED. CUT FOR VIEWING) BY FIELD1 NOPRINT BY FIELD2 NOPRINT BY FIELD3 NOPRINT ON TABLE PCHOLD FORMAT ALPHA END -RUN -EXITThis message has been edited. Last edited by: FP Mod Chuck,
Web Focus Developer Studio Release 7.6.1 Output formats include Excel, PDF, HTML, XML.
August 27, 2018, 02:57 AM
Frans
Try this:
FILEDEF TXTFILE DISK txtfile.txt (APPEND
DEFINE FILE FOCTPUL8
LINE1/A150 = 'HEADER RECORD - NO. OF RECS' | ' ' | COUNTER |' ' | ('TIMESTAMP ' | ' ' ) | RUN_DATE;
END
-*******************************************************************************
SET COMPOUND = OPEN
-*******************************************************************************
TABLE FILE FOCTPUL8
PRINT
LINE1
WHERE RECORDLIMIT EQ 1;
ON TABLE TXTFILE FORMAT ALPHA
END
-RUN
-*******************************************************************************
SET COMPOUND = CLOSE
-*******************************************************************************
TABLE FILE FOCTPUL8
PRINT
(ALL FIELDS ARE LISTED. CUT FOR VIEWING)
BY FIELD1 NOPRINT
BY FIELD2 NOPRINT
BY FIELD3 NOPRINT
ON TABLE TXTFILE FORMAT ALPHA
END
-RUN
EX EDAGET TXT, txtfile.txt,T