Home
Analytics
How to prompt file save as?
Allaj
Hello,
My client want the output PDF report automatically be uploaded on the browser's user computer, so that the user will be prompt with the ?save as? question.
Is there a possibility to achieve that with the BIRT viewer? What needs to be done? Is that about changing the header? Can the filter do the job? Snipped of code would be very much appreciated.
thanks
Find more posts tagged with
Comments
averma
Hi Alla:
What is your deployment environment? Are you using Actuate viewer/iServer(Express)?
Ashwini
iletra
Did you find a way to prompt the save as window?
al91206
We're running Actuate 10 / iServer Express / BRT 2.3.2
Thanks!
Al in SoCal
averma
Hi Al,<br />
You could use URL access to directly launch the report in PDF format using the URI parameter __format. Here is an example:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
http://localhost:8900/iportal/executereport.do?&__executableName=/Public/BIRT and Business Reports Examples/Customer Dashboard.rptdesign&__requesttype=immediate&__format=PDF
</pre>
<br />
AV
Virgil Dodson
Hi Alla and iletra,<br />
<br />
The open source BIRT viewer also has a PDF format option so a URL would look like:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>http://localhost:8080/BIRT_Web_Project/frameset?__report=test.rptdesign&sample=my+parameter&__format=PDF</pre>
<br />
...but that will still try to open the PDF file unless a user has changed their browser settings. You could try modifying the servlet used to dish out the PDF file so that it has the proper header to force a SaveAs dialog... that will look something like<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>setHeader("content-disposition", "attachment;filename=mypdfdocument* .pdf")</pre>
<br />
The Viewer Servlets are in the org.eclipse.birt.report.viewer project... and instructions for getting the BIRT source code is available at:<br />
<a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/build/buildInstructions.php'>How
to Build BIRT from CVS</a>