| |
KnowledgeBase for ActiveReports for .NET
02-06-2008, 2:33 PM
|
|
|
|
Exporting and Displaying a PDF in an IFRAME.
It is sometimes necessary to run your reports out of process in order to avoid issues with IIS and isolated storage. Because of how IIS and isolated storage work, you may receive a 'No Report Specified' error in the Web Viewer when IIS memory is recycled.
An easy workaround is to replace the Web Viewer control with an IFRAME, and then display a PDF export of your report within this IFRAME. For improved memory performance, the PDF can then be generated outside of the current ASP.NET worker process, such as by using a Web service. This is what we will be using in this example.
If you look at the attached sample, you can see how this is done. Basically, your main ASPX page will have an IFRAME tag. Its src attribute is set to "PDFPage.aspx". When the page is loaded, PDFPage.aspx will be requested and then displayed inside of the IFRAME. In the codebehind of PDFPage.aspx, a new instance of the Web service is created, and the GenereatePDF method is called. This method will create a new report object, run the report, and then export it to PDF. The resulting PDF is then returned to PDFPage.aspx in a memory stream. The memory stream is then sent to the browser in the Response.BinaryWrite method.
Please note, in order to view the PDF, a PDF viewer plug-in will need to be registered with the browser you are using. Also, you will need to ensure that your client’s browser supports IFRAME tags.
Other export formats can be sent to the browser as well. Walkthroughs for these formats can be found here: http://www.datadynamics.com/Help/ARNET3/ar3oriCustomExportingWalkthroughs.html
We also have some other examples of using Web Services, which can be found here: http://www.datadynamics.com/Help/ARNET3/ar3oriWebServicesWalkthroughs.html
Applies To: ActiveReports for .NET 3.0
|
|
|
|
|
|
GrapeCity » Knowledge Base » KnowledgeBase f... » Exporting and displaying a PDF in an Iframe.
|
|
|
|
|