PDF Export
I am trying to do a direct export to a PDF from a web application.
If I try the simple statement
export.export(rptMain) where rptMain is my report and export has been set as a PDFExport, I will get the following web error:
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
I can get around this by using export.export(rptMain, filename) but then I need to know where to save the file on the users machine.
So I have 2 questions:
1. Is there a way to export directly and let the standard download mechanism take over. For example if I use the WebReport control, show the report and then export it to PDF, I get a standard SAVE dialog box with the option to save to a particular directory and change the file name.
2. If #1 is not possible, is there a way to retrieve the default download directory used by the browser and then save the file into this directory? I am assuming this will be the standard windows My Documents\My Downloads directory.
Thanks.
Alan
If I try the simple statement
export.export(rptMain) where rptMain is my report and export has been set as a PDFExport, I will get the following web error:
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
I can get around this by using export.export(rptMain, filename) but then I need to know where to save the file on the users machine.
So I have 2 questions:
1. Is there a way to export directly and let the standard download mechanism take over. For example if I use the WebReport control, show the report and then export it to PDF, I get a standard SAVE dialog box with the option to save to a particular directory and change the file name.
2. If #1 is not possible, is there a way to retrieve the default download directory used by the browser and then save the file into this directory? I am assuming this will be the standard windows My Documents\My Downloads directory.
Thanks.
Alan
Comments
Use Report component when exporting to pdf.
You may export the report to a stream and write that stream to a page response.
This doesn't work any better than export.export(fname). I still do not get a save file dialog box which means I have to decide where on the users machine to place the report - it should be their decision. If I just do report.export(export, 'result.pdf'), I get a access denied error because it tried to right to the server.
Thank-you. I guess the only way to do this is to place a WebReport on the form, make it invisible and then have a button that calls PDFPrint. It seems like a lot of overhead for such a simple request.