Create a PDF report without using webviewer

Stimulsoft Reports.WEB discussion
Post Reply
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

Create a PDF report without using webviewer

Post 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.

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Create a PDF report without using webviewer

Post by Jan »

Hello,

Please use following code:

Code: Select all

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