×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




I'm not very well versed in how cgidev2 works (just played briefly
with it) but....

If you can already create the PDF and can give it a unique name via
the CGI program, the program can tell the browser to open the pdf in a
separate window by pushing the following code back to the browser via
std out - (this is the only reply the browser receives from the CGI
report request):

C                   eval      OutStr = 'Content-Type:  Text/HTML' +
C                              $CrLf + 'Pragma: no-cache'         +
C                              $CrLf + 'Expires: 0'               +
C                              $CrLf + 'Cache-Control: no-cache'  +
C                              $CrLf + $CrLf                      +
C                              '<html><script language=JavaScript>' +
C                              $CrLf +
C                              'var pdfWindow = window.open("' +
C                              %trim(PDFPATH) + ",'         +
C                              '"pdfWindow","scrollbars,resizable,' +
C                              'width=750,height=540");'+ $CrLf     +
C                              'pdfWindow;'             + $CrLf     +
C                              'pdfWindow.moveTo(3,3);' + $CrLf     +
C                              'history.back();'       + $CrLf     +
C                              '</script></html>'
C                   exsr      $APIStdOut

- PDFPATH is the webserver defined path to the IFS location and file
name.  example:

/webdirectory/pdfs/mypdffilename.pdf

the code will open a new window, and the pdf extension tells the
browser to open adobe reader and download the file.

after the new window is displayed, the original browser will return -
using history.back() - to the page that requested the report.

hope this helps a little.

On 12/28/06, Jim Horn <jimh@xxxxxxxxxxxxxx> wrote:
To make a long story short, we will be converting an old reporting system to
use cgidev2 to

Request parameters from the user via a browser
create pdf/html reports in the IFS based on browser requests
retrieve the reports and send them back to the requesting browser.
would prefer not to send a link.

Need some assistance on the retrieve from the ifs and send back vis cgi
part.

Any examples of doing this out there?

Thanks

Jim Horn

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.