Debra Waybright Posted April 14, 2023 Share Posted April 14, 2023 I'm trying to set up a process to generate a compound document for a list of agencies but I'm getting errors from the compound document piece. I found this Focal Point post: http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1207095086 which helped but it still isn't quite working. If my loop is for just one agency it will work, but if I try for more, I get "request terminated" "hard kill" error. 😢 The compound document is a basic report plus a graph on one page for each policy. I'm running in 8207. We're getting ready to upgrade to 91 but that doesn't seem to make a difference.Any ideas? Link to comment Share on other sites More sharing options...
David Beagan Posted April 19, 2023 Share Posted April 19, 2023 How are you looping. A -REPEAT loop? Link to comment Share on other sites More sharing options...
Debra Waybright Posted April 19, 2023 Author Share Posted April 19, 2023 Yes. Here's the basic code: TABLE FILE SQLOUTPRINT AGENCY_NUMBERON TABLE SAVE AS MYOUT FORMAT ALPHAEND-IF &LINES LE 0 GOTO NO_RPT;-RUN-SET &LOOPS = &LINES;-TYPE &LOOPS;-REPEAT END_REPEAT &LOOPS TIMES-READ MYOUT,NOCLOSE &AGENCY_NUMBER.A4-SET &NAME1 = &AGENCY_NUMBER || &FILE_NAME.EVAL;-SET &NAME3 = &NETWORK_LOCATION || &NAME1;FILEDEF &NAME1 DISK &NAME3EX enterprise_analytics/myreport ME_DATE=&ME_DATE, AGENCY_NUMBER=&AGENCY_NUMBER, POLICY_NUMBER=&POLICY_NUMBER, NAME1=&NAME1-RUN-CLOSE &NAME1-END_REPEAT-NO_RPTInside the report code I have this:COMPOUND LAYOUT HOLD AS &NAME1 FORMAT PDFFollowed by all the compound document stuffs with this in the TABLE command for both the report and the graph:ON TABLE PCHOLD FORMAT PDF Link to comment Share on other sites More sharing options...
David Beagan Posted April 19, 2023 Share Posted April 19, 2023 I used your code to write something similar using ggsales. baseapp/agency_reports.fex-SET &ME_DATE = &DATEYYMD;-SET &NAME1 = 'Mutual';-SET &POLICY_NUMBER = 910;-SET &FILE_NAME ='filenm';-SET &NETWORK_LOCATION = 'C:ibiappsbaseapp'; TABLE FILE ggsales PRINT SEQ_NO AS 'AGENCY_NUMBER' WHERE RECORDLIMIT IS 5 ON TABLE SET ASNAMES ON ON TABLE SAVE AS MYOUT FORMAT ALPHA END -IF &LINES LE 0 GOTO NO_RPT;-RUN-SET &LOOPS = &LINES;-TYPE &LOOPS -REPEAT END_REPEAT &LOOPS TIMES-READ MYOUT,NOCLOSE &AGENCY_NUMBER.A5-SET &NAME1 = &AGENCY_NUMBER || &FILE_NAME.EVAL;-SET &NAME3 = &NETWORK_LOCATION || &NAME1 || '.pdf'; FILEDEF &NAME1 DISK &NAME3 EX baseapp/agency_report.fex ME_DATE=&ME_DATE, AGENCY_NUMBER=&AGENCY_NUMBER, POLICY_NUMBER=&POLICY_NUMBER, NAME1=&NAME1 -RUN-CLOSE &NAME1-END_REPEAT -NO_RPTbaseapp/agency_report.fex TABLE FILE ggsales "ME_DATE = &ME_DATE" "AGENCY_NUMBER = &AGENCY_NUMBER" "POLICY_NUMBER = &POLICY_NUMBER" "NAME1 = &NAME1" " " PRINT SEQ_NO UNITS DOLLARS WHERE SEQ_NO EQ &AGENCY_NUMBER ON TABLE HOLD AS &NAME1 FORMAT PDF ENDI get five pdf files in the baseapp folder, although they are not compound reports. Does this work for you? Link to comment Share on other sites More sharing options...
Debra Waybright Posted April 20, 2023 Author Share Posted April 20, 2023 The process works fine if it isn't a compound document. I have another similar process which creates PDF files with several reports (no graphs) but each report is its own page. Maybe I should test to see if it is the graph that's the problem or the compound... Link to comment Share on other sites More sharing options...
Debra Waybright Posted April 27, 2023 Author Share Posted April 27, 2023 Finally got back to this. It must be the compound. If I change it to create a compound document with 2 reports on the page instead of a report and a graph, it runs, but it only generates the first report. Link to comment Share on other sites More sharing options...
Solution Debra Waybright Posted October 2, 2023 Author Solution Share Posted October 2, 2023 I finally got it working!Here are the important pieces:In the base fex, have this at the beginning in the REPEAT loop for the file you want to save the compound report to:FILEDEF &NAME1 DISK &NAME3In the report fex you EX in the loop:COMPOUND LAYOUT HOLD AS &NAME1 FORMAT PDFthen the normal COMPOUND syntax, BUT exclude the ON TABLE HOLD line from the reports that are part of the COMPOUND document. I think this was the bit I had wrong before. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now