Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compound PDF 1

Status
Not open for further replies.

2wayparadise

Programmer
Jan 24, 2007
7
US
I have a 8 pages compound PDF was gererated by passing a SSN as the required parameter.

I like to run a batch of SSNs which is created by State code. Example is in state of 'CA', I have 21 SSNs pull and was created in a comma delimited file format like
"SSN1,SSN2,SSN3,..."

How do I read the SSN file with 1 by 1 of the SSN pass to my compound PDF fex and keep all 8 pages within the same SSN together.

Thanks.
 
I think I need some clarification. You say you have an 8 page compound PDF output, by passing in a SSN. Is that 8 separate reports, or one report with 8 pages, or some other combination (I suspect 8 separate reports)?

Now, you want to pass MULTIPLE SSNs to the report, and group them by state. Is that correct? Thus, each of the different reports will include all the SSNs for that state. Is there one report with all the SSNs, or one page or each report per SSN?

Do you want 'like' reports together, or 8 reports for SSN1, followed by 8 reports for SSN2, etc.

Ultimately, it sounds like you need a loop, controlled by the Dialogue Manager.
 
Hi focwizard,

I have 1 focexex produce 8 pages of PDF which have different info by joining to additional table. when I

EX PDF8P SSN='123456789' it will produce 8 pages compound PDFs

Now I have a STATE ID, example: CA, it contains 9 SSNs
in a holding file like

CA SSN
-- ---------
CA 111111111
CA 222222222
CA 333333333
.
.
.
CA 99999999

How do I read each of the SSN and pass it to my PDF8P as a parameter and loop thought all 9 SSNs and produce a total of 72 Pages of compound PDF in 1 execution

The PDF should be in SSN=111111111,P1 to P8 and SSN=222222222, P1-P8, SSN=333333333, P1-P8...

Thanks for your help

2wayparadise
 
Hi focwizard,

Need your help of how to read the SSN in hold file 1 by 1 in a loop ?

Thanks.

2Wayparadise
 
Ah, now I see. You just want to loop through a list of SSNs in a file, and execute this procedure for each SSN you read, and have the entire output as a single PDF document. Is that it?

First, you should create a HOLD file (in ALPHA format), of the SSNs you want. Keep the number of records (&LINES) in a different variable (&NUMSSNS). Then, use the Dialogue Manager to read the list, one at a time, and process them.

It might look like this:

Code:
TABLE FILE holdfile
PRINT SSN
ON TABLE HOLD AS SSNLIST FORMAT ALPHA
END
-RUN
-SET &NUMSSNS = &LINES;
-IF &LINES EQ 0 GOTO EXIT;
-REPEAT ENDLOOP FOR &CTR FROM 1 TO &NUMSSNS
-READ SSNLIST NOCLOSE &SSN.A9.
-SET &OPENCLOSE = IF &NUMSSNS EQ 1 THEN ' ' ELSE
-                 IF &CTR EQ 1 THEN 'OPEN' ELSE
-                 IF &CTR EQ &NUMSSNS THEN 'CLOSE' ELSE ' ';
-IF &OPENCLOSE EQ ' ' GOTO NOSET;
SET COMPOUND = &OPENCLOSE
-NOSET
EX PDF8P SSN=&SSN
-RUN
-ENDLOOP

What this does is:

&NUMSSNS is used to determine WHEN COMPOUND should be set to 'CLOSE' (on the last report). The first report has COMPOUND set to OPEN; intermediate reports don't set it at all. And, if &NUMSSNS is 1, you don't HAVE a compound report.

The -READ has a NOCLOSE option, so that file stays open, allowing you to read the 'next' record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top