Page 1 of 1

Create a PDF report without using webviewer

Posted: Wed Sep 23, 2009 12:13 pm
by fuhrj
I need the ability to create a report without using the webviewer control. For example, on a web page, there is a Print button. When the user clicks that button, I want it to open a PDF version of the report. I don't want to display it in a browser.

I thought it was as straight-forward as doing this:

Code: Select all

                    Stimulsoft.Report.Web.StiWebViewer webView = new Stimulsoft.Report.Web.StiWebViewer();
                    webView.Report = report;
                    webView.PrintToPdf();
But it bombs on line 2 with Object Reference not set error.


Create a PDF report without using webviewer

Posted: Wed Sep 23, 2009 1:54 pm
by Jan
Hello,

Please use following code:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(page, report);
Thank you.