on 02-23-2008 1:16 PM
Hi all,
we are creating dynamic PDF Reports and store them in an xMII Web folder like "/Project/WEB/PDFFiles/".
The problem is that I cannot display the PDF File after creation to the user, because when I use the URL it says an error like "file cannot be found". Only after I open the Workbench and "publish" the file, the URL works and the PDF is opened.
Can I execute the "publish" command from the web page via JavaScript? Or from the BLS after it has created the PDF?
Regards
Michael
Michael, you can also stream the PDF files directly from the BLS transaction to the browser, without the need for temporary storage. This is a better approach if these PDF files are "single use", whereas the "publishing" approach is best if many users will want to view the same PDF file(s).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Michael.
The rendered PDF document is stored in a "string" parameter. Create a transaction output parameter of type string, and name it "PDFContent". Now, to stream the data back, create a hyperlink of the format:
http://<yourserver:yourport>/<this depends on your version>/Runner?Transaction=YourFolder/YourTransaction&OutputParameter=PDFContent&OutputContentType=application/pdf
When the user clicks on this link, the PDF will be generated and sent to the browser and should automatically open the Adobe PDF Reader. Note that this technique can be used with all kinds of different content (I've done the same for BLS-created HTML, SVG, PDF, CSV, and even Minitab statistical files).
In some cases, you may need to "trick" IE into forcing an open of the PDF viewer, in which case you might want to tweak the URL as follows:
http://<yourserver:yourport>/<this depends on your version>/Runner?Transaction=YourFolder/YourTransaction&OutputParameter=PDFContent&OutputContentType=application/pdf&PDFContent.pdf
Sometimes IE uses the ".pdf" at the end, sometimes it uses the content type/mime type. Seems inconsistent.
Best regards,
Rick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.