Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Getting errors trying to write Compound Documents to file


Debra Waybright
Go to solution Solved by Debra Waybright,

Recommended Posts

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

Yes. Here's the basic code:

TABLE FILE SQLOUT

PRINT AGENCY_NUMBER

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.A4

-SET &NAME1 = &AGENCY_NUMBER || &FILE_NAME.EVAL;

-SET &NAME3 = &NETWORK_LOCATION || &NAME1;

FILEDEF &NAME1 DISK &NAME3

EX enterprise_analytics/myreport ME_DATE=&ME_DATE, AGENCY_NUMBER=&AGENCY_NUMBER, POLICY_NUMBER=&POLICY_NUMBER, NAME1=&NAME1

-RUN

-CLOSE &NAME1

-END_REPEAT

-NO_RPT

Inside the report code I have this:

COMPOUND LAYOUT HOLD AS &NAME1 FORMAT PDF

Followed 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

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_RPT

baseapp/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 END

I 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

  • 5 months later...
  • Solution

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 &NAME3

In the report fex you EX in the loop:

COMPOUND LAYOUT HOLD AS &NAME1 FORMAT PDF

then 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...