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     [Only Mostly Solved] Archive PDF file to disk, then send to browser?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Only Mostly Solved] Archive PDF file to disk, then send to browser?
 Login/Join
 
Virtuoso
posted
I have an existing system that pounds out thousands of letters with unique materials in them, and a new requirement has come to light to create an archive on a drive at the same time it is returned to the user. I'm trying to figure out if there's a good way to retrofit what we have here. More or less this is what I'm trying to do:

TABLE FILE CAR
PRINT *
ON TABLE PCHOLD FORMAT PDF
ON TABLE HOLD FORMAT PDF AS ARCHIVE
END

I have a filedef for ARCHIVE and can get it to write to the drive, and I can get it to return to the client. The problem is that I can't get it to do both. It only does the second one it finds. I don't want to rewrite all of the calls to double-call the base report, so I'm trying to find a creative way to get both.

I'm on a two-tier so the idea of just rerouting the url to a folder where it can be returned the old-fashioned way is a bit harder than it needs to be.

Does anyone know of a sneaky way to get it to route to two destinations?

I've tried dropping the result into the approot and addressing it like this --

/ibi_apps/approot/madap_letters/vpdoc.pdf


. . . but I get this in return: "The requested resource (/ibi_apps/approot/madap_letters/vpdoc.pdf) is not available."

J.

This message has been edited. Last edited by: John_Edwards,



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
How about using edaget:

-SET &ECHO = 'ALL';

-*-- Set up the file name ----------------------------------
-SET &FILE_NAME = &YYMD || '_' || EDIT(&TOD,'99$99$99') || '_output01.pdf';

FILEDEF OUTPUT01 DISK baseapp/&FILE_NAME
-RUN

-*-- Create the report -------------------------------------
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
ON TABLE HOLD AS OUTPUT01 FORMAT PDF
END
-RUN

-*-- Display the report ------------------------------------
EX EDAGET PDF,baseapp/&FILE_NAME,B
-RUN


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
Virtuoso
posted Hide Post
Ladies and Gentlemen, it appears I owe Mr. Mariani yet another beer. I believe I'm one shy of a six-pack.

I have never even heard of EDAGET until now. That is one seriously useful program right there.

[SOLVED]



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Another Guinness please.



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
Member
posted Hide Post
Excellent tip Francis!
Good One


WebFOCUS 7.6.1
Windows, HTML,PDF,EXCEL2000
 
Posts: 21 | Registered: November 27, 2013Report This Post
Virtuoso
posted Hide Post
Alright, so this is more or less in, but I'm having a problem with big files, anything exceeding seven pages. My pdf gets cropped on the disk. I tried adding an LRECL to the Filedef but it didn't make a difference.

FILEDEF VPDOC DISK &ARCHPATH&FILE_NAME.pdf (LRECL 100000000

So it appears I'm hitting a hard limit on my size. Does this make any sense?



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Uh oh.

The LRECL won't help, it has nothing to do with the file size - it might affect the single record size of a text file.

Unfortunately, WebFOCUS generates unnecessarily large PDF and Excel files.
According to dhagen in this post from 2013, EDAGET is a "high performance" way to move files, so it's surprising it cannot copy a seven page pdf file.

Here is another method of doing this, using meta refresh. This will only work if the reporting server and web server are on the same machine. It will also work if the web server can reference a folder on the reporting server. (I'm not sure what will happen if the file is large).

-SET &ECHO = 'ALL';

-*-- Set up the file name ----------------------------------
-SET &FILE_NAME = &YYMD || '_' || EDIT(&TOD,'99$99$99') || '_output01.pdf';

FILEDEF OUTPUT01 DISK baseapp/&FILE_NAME
-RUN

-*-- Create the report -------------------------------------
TABLE FILE CAR
SUM SALES
BY COUNTRY
BY CAR
ON TABLE HOLD AS OUTPUT01 FORMAT PDF
END
-RUN

-*-- Display the report ------------------------------------
-HTMLFORM BEGIN
<HTML>
<HEAD>
<meta http-equiv="refresh" content="0; url=/approot/baseapp/!IBI.AMP.FILE_NAME;">
</HEAD>
</HTML>
-HTMLFORM END



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
Virtuoso
posted Hide Post
I just confirmed that it is creating the complete file on the disk. And they're not too big -- 500k for some.

So, either EDAGET is not up to the task, or the pdf is not completing its save prior to EDAGET coming to grab it. Need to figure out which.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
EDAGET can't seem to handle files much above 200K. It truncates what remains.

Wish I had figured that out ahead of time.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
No Guinness for me then.


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
Expert
posted Hide Post
Using this text fex, I had no problem with EDAGET, it created a pdf with file size of 1,013 KB.

-SET &ECHO = 'ALL';

-*-- Set up the file name ----------------------------------
-SET &FILE_NAME = &YYMD || '_' || EDIT(&TOD,'99$99$99') || '_output01.pdf';

FILEDEF OUTPUT01 DISK baseapp/&FILE_NAME
-RUN

-*-- Create the report -------------------------------------
TABLE FILE CAR
PRINT *
ON TABLE HOLD AS OUTPUT01 FORMAT PDF
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
END
-RUN

-*-- Display the report ------------------------------------
-HTMLFORM BEGIN
<HTML>
<HEAD>
<meta http-equiv="refresh" content="0; url=/approot/baseapp/!IBI.AMP.FILE_NAME;">
</HEAD>
</HTML>
-HTMLFORM END


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
Virtuoso
posted Hide Post
Using EDAGET, or the url redirect? You're showing a url redirect.

My reporting server is behind a firewall.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Sorry about that. This one works. It creates a file of 1,269kb. I tried to use EDAGET with a pre-existing pdf file (I used one of the WebFOCUS documentation files and I get an error: "The file is damaged and could not be repaired".



-SET &ECHO = 'ALL';
 
-*-- Set up the file name ----------------------------------
-SET &FILE_NAME = &YYMD || '_' || EDIT(&TOD,'99$99$99') || '_output01.pdf';
 
FILEDEF OUTPUT01 DISK test/&FILE_NAME
-RUN
 
-*-- Create the report -------------------------------------
TABLE FILE CAR
PRINT *
ON TABLE HOLD AS OUTPUT01 FORMAT PDF
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
MORE
FILE CAR
END
-RUN
 
-*-- Display the report ------------------------------------
EX EDAGET PDF,test/&FILE_NAME,B
-RUN


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
Virtuoso
posted Hide Post
Not exactly sure how to interpret what you wrote above, but the example you just provided with EDAGET produces the same error I'm seeing here, a partial pdf that throws an error when you get down a few pages. It appears to simply not be a complete pdf file. It appears EDAGET simply can't get a file much bigger than 200k.

That's a shame.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Expert
posted Hide Post
Sorry for the confusing comment. All the code I added to this thread works on my local PC and also on our server. I should have stated that I ALSO tried to use EDAGET with the pre-existing file. Perhaps there's an issue with the web server.

Have you tried running a test on your localhost - the local environment accessible via Developer Studio?


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Only Mostly Solved] Archive PDF file to disk, then send to browser?

Copyright © 1996-2020 Information Builders