Direct Printing

Stimulsoft Reports.BLAZOR discussion
Post Reply
admin@secsol.co.uk
Posts: 16
Joined: Wed Jun 01, 2022 8:26 am

Direct Printing

Post by admin@secsol.co.uk »

I am trying to print directly from my Report (without having to view a preview)

I have create a Report and loaded the report but when I call :

Report.Print();

It throws an Exception error :

System.NullReferenceException: 'Object reference not set to an instance of an object.

Should just calling Print() allow the end user to select the printer and other options ?
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Direct Printing

Post by Max Shamanov »

Hello,

You can use the following code:

Code: Select all

StiReportResponse.PrintAsPdf(report);
Thank you.
admin@secsol.co.uk
Posts: 16
Joined: Wed Jun 01, 2022 8:26 am

Re: Direct Printing

Post by admin@secsol.co.uk »

I tried this after loading my report

StiReportResponse.PrintAsPdf(report);

and nothing happened.... no print or preview or request to save as......
admin@secsol.co.uk
Posts: 16
Joined: Wed Jun 01, 2022 8:26 am

Re: Direct Printing

Post by admin@secsol.co.uk »

Okay, I have found this in the manual : (even though I have a Report Viewer on this page)

StiBlazorHelper.Initialize(JsRuntime);

If I do this first the PDF is displayed n the web browser.

I don't want this, i want to send the PDF to a printer directly not to preview it first
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Direct Printing

Post by Max Shamanov »

Hello,

Please clarify, is the printer connected on the client side or on the server side?

Thank you.
admin@secsol.co.uk
Posts: 16
Joined: Wed Jun 01, 2022 8:26 am

Re: Direct Printing

Post by admin@secsol.co.uk »

The printer is on the client side
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Direct Printing

Post by Max Shamanov »

Hello,

Due to the browser security limitations, in the web browsers, it is not possible to send printers settings in print dialog menu.

Thank you.
Post Reply