Focal Point
[CLOSED] Calling Existing PDF/Excel Files

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5267036716

March 09, 2012, 09:55 AM
DMA
[CLOSED] Calling Existing PDF/Excel Files
I need to have an HTML page with two parameters (District, Branch) and two buttons, one that calls a PDF file and one that calls an Excel file. The PDF & Excel files need to be called according to the chosen parameters. Ex: I choose the Seward Park District and the Hudson Park Branch and I click the PDF button. I need to call the URL for the PDF file that already exists, I'm not creating it on the fly. There are 173 different files, is there a way to use just two buttons, one that calls the PDF files and one that calls the Excel files, to do this without having to create 173 buttons?

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


WebFOCUS v. 7.6.8 || Windows XP || Format Output: HTML, PDF, EXCEL
March 09, 2012, 10:35 AM
j.gross
Two approaches:

1. Call a fex, feeding it the two location parameters and the format info, to compute the required url and deliver an html page that replaces itself with the url.

2. Have javascript within the launch page compute the required url, imbed that info in form and submit it.
March 09, 2012, 11:45 AM
TexasStingray
If the files are accessable via a direct url options 2 would be better. Another option would be just have WebFOCUS create a report that has the links to the url using the html code.




Scott

quote:
Originally posted by j.gross:
Two approaches:

1. Call a fex, feeding it the two location parameters and the format info, to compute the required url and deliver an html page that replaces itself with the url.

2. Have javascript within the launch page compute the required url, imbed that info in form and submit it.


Do you have sample code for either of these that I could take a look at?


WebFOCUS v. 7.6.8 || Windows XP || Format Output: HTML, PDF, EXCEL
How are the Excel / PDF files named?
How does the filename reflect the selected branch (or branch within district)?

For 1., have fex compute the file's &url as "http://[server]/[path]/[filename]", and use -htmlform to compose a redirect page, referencing the file as "!IBI.AMP.url;".

See, for example, http://en.wikipedia.org/wiki/URL_redirection for how to code a redirect page.

For 2., Build your html page in html composer, with the two controls as part of a form, where the submit button calls a static arbitrary url. Have your pre-submit validation js routine replace the form's action attribute with the url.

This message has been edited. Last edited by: j.gross,