Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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, 2003Report 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, 2003Report 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, 2003Report 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, 2005Report 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, 2003Report 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, 2009Report 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 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report 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, 2005Report 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 
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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-2020 Information Builders