Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Multiple compound PDF files in a read loop
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Multiple compound PDF files in a read loop
 Login/Join
 
Silver Member
posted
Using WF 5.33 on Windows 2000.

In the same program I had the -REPEAT question, I have another one related to multiple PDF files being generated.

Basic code:
-REPEAT ...
-READ ...
SET COMPOUND = OPEN
TABLE FILE FN
....
ON TABLE PCHOLD AS PDF
END
SET COMPOUND = CLOSE
TABLE FILE FN
....
ON TABLE PCHOLD AS PDF
END

Instead of using PCHOLD, I want to hold/save each compound file as a unique name on my server.
Something like this.

-REPEAT ...
-READ ...
-SET PRTFN = &VAR1||&VAR2;
-* var1 & var2 comes from the file read

SET COMPOUND = OPEN
TABLE FILE FN
....
ON TABLE HOLD AS PDF
END
SET COMPOUND = CLOSE
TABLE FILE FN
....
ON TABLE PCHOLD AS &PRTFN
END

This is not working, I only get the first report in the brower. It won't save it to the server.

Anyone got any ideas how to hold/save each PDF report as a unique name and have the loop continued, doing the next read and hold?

Thanks,
Raelene

This message has been edited. Last edited by: Kerry,
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Reply With QuoteReport This Post
Virtuoso
posted Hide Post
ON TABLE HOLD FORMAT PDF would be the correct syntax. AS PDF just names it 'PDF'.
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Reply With QuoteReport This Post
Silver Member
posted Hide Post
Ooops, that was a typo. I knew that part.

The part I'm having trouble with is saving the compound report as a unique name to the server under a specific directory. The PDF files will be picked up by another software/person for printing. Since the compound report consists of two PDF reports, I can't figure out how to save them to the server because there are two names (one for the first table file, the second for the second table file). Does this make more sense?
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
Add a FILEDEF command for the PDF reports you want saved on the server. Put the FILEDEF within the loop.

-SET &FILE_NAME = 'c:\some\where\on\the\server\' | &PRTFN || '.pdf';
FILEDEF &PRTFN DISK &FILE_NAME
-RUN
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Silver Member
posted Hide Post
This is the resolution in case anyone needs it.

-** Set up error
-SET &CTR=0;
-** Initialize IORETURN for the Repeat Loop
-SET &IORETURN = 0;
-*** Set up the file name and file def for the external file.
-SET &FILE_NAME='D:\PATHNAME\DATA.DAT';
FILEDEF FN DISK &FILE_NAME
-RUN
-********************
-**** START LOOP ****
-********************
-REPEAT :END_LOOP WHILE &IORETURN EQ 0;
-***** read in input data from external file *****
-READ AS_PRINT,NOCLOSE &VAR1 &VAR2 &VAR3
-IF &IORETURN NE 0 GOTO :END_LOOP;
-*********************************************************************
-*** Set up file def for compound PDF hold file.
-*** Each report will be saved to the server with a unique file name.
-*********************************************************************
-** Add 1 to counter, this is part of the PDF file name.
-SET &CTR = &CTR + 1;
-SET &PRT_FLNM='AS_'||&CTR||'.PDF';
-SET &HOLDAS = 'AS_'||&CTR;
FILEDEF &HOLDAS DISK D:\PATHNAME\&PRT_FLNM
-RUN
-*** create report1
TABLE FILE FILENAME1
PRINT...
ON TABLE HOLD AS &HOLDAS FORMAT PDF OPEN
END
-RUN
-*** create report2
TABLE FILE FILENAME2
PRINT ...
ON TABLE HOLD AS &HOLDAS FORMAT PDF CLOSE
END
-RUN
-:END_LOOP
-**********************
-**** END OF LOOP ****
-**********************
 
Posts: 31 | Location: Oklahoma City, OK | Registered: September 11, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I want to display two PDF's in the browser from a compound report, not save them to a server. Is this possible?


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
 
Posts: 106 | Registered: June 25, 2009Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You mean two different PDF documents in one browser instance?
Don't know if that's possible, never seen it done.
But maybe it can be done if you have two iframes on the page and populate each one with it's own pdf. Really no idea if that might work.


GamP

- Using AS 8.2.01 on Windows 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
If it's a compound report, it's one PDF file.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
<JG>
posted
Depending on your browser settings this will open the PDFs either in the frames
or will open 2 acrobat documents. Note the PDF outputs must be saved to a webserver readable location

 APP FI PDF1 DISK baseapp/PDF1.PDF
APP FI PDF2 DISK baseapp/PDF2.PDF
-RUN
TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS PDF1 FORMAT PDF
END
-RUN
TABLE FILE CAR
BY CAR
ON TABLE HOLD AS PDF2 FORMAT PDF
END
-RUN
-HTMLFORM BEGIN
<HTML>
<body>
<iframe src='http://localhost:9090/approot/baseapp/pdf1.pdf'>
</iframe>
<iframe  src='http://localhost:9090/approot/baseapp/pdf2.pdf'>
</iframe>
</body>
</html>
-HTMLFORM END 
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Multiple compound PDF files in a read loop

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.