Display report directly in PDF

Stimulsoft Reports.WEB discussion
Post Reply
Rajesh Tanwar
Posts: 14
Joined: Thu May 14, 2009 2:06 am

Display report directly in PDF

Post by Rajesh Tanwar »

Hi All,

On stimulsoft web viewer, when we click on "Print to PDF" option, report is shown in pdf format.
How I can view report in pdf format without the use of web viewer?

Second, when we click on "Print to PDF", there comes a dialog asking whether to "Open" file, "Save" file or "Cancel". When viewing report programatically, I want that dialog should not appear. Instead report should open directly in pdf. How I can achieve this?
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Display report directly in PDF

Post by Jan »

Hello,
On stimulsoft web viewer, when we click on "Print to PDF" option, report is shown in pdf format.
How I can view report in pdf format without the use of web viewer?
You can use following code in PageLoad event of web page:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report);
Second, when we click on "Print to PDF", there comes a dialog asking whether to "Open" file, "Save" file or "Cancel". When viewing report programatically, I want that dialog should not appear. Instead report should open directly in pdf. How I can achieve this?
You can use two variants:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report, true);
//With dialog box

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report, false);
//Without dialog box

Thank you.
Rajesh Tanwar
Posts: 14
Joined: Thu May 14, 2009 2:06 am

Display report directly in PDF

Post by Rajesh Tanwar »

Hi Jan,

thanks for the support.
My first problem is solved.

For the second problem, I want to display report on new page, but don't want to display the dialog (having option of "Open","Save" and "Cancel").
If I use following code...

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report, false);
then report is shown on the current page. But I want to show it on new page.

Thanks,
Rajesh Tanwar
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Display report directly in PDF

Post by Vladimir »

Hello,

See the sample in attached archive.

Thank you.
Attachments
181.ShowPdfInNewPage.zip
(4.48 KiB) Downloaded 516 times
Rajesh Tanwar
Posts: 14
Joined: Thu May 14, 2009 2:06 am

Display report directly in PDF

Post by Rajesh Tanwar »

Hi Vladimir,

Thanks for the sample.
My second problem is also solved.:biggrin:

Regards,
Rajesh Tanwar
gabrielw3n
Posts: 14
Joined: Mon Aug 21, 2017 5:10 pm

Re: Display report directly in PDF

Post by gabrielw3n »

Hi..

How can I do it using JS?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Display report directly in PDF

Post by Alex K. »

Hello,

Please check the sample at the following link:
https://www.stimulsoft.com/en/samples/j ... ort-to-pdf

Thank you.
Post Reply