Blazor - Download PDF - error

Stimulsoft Reports.BLAZOR discussion
Post Reply
Jose
Posts: 16
Joined: Thu Oct 17, 2019 8:42 am

Blazor - Download PDF - error

Post by Jose »

Hi!

I make a PDF from report:

Stimulsoft.Report.Export.StiPdfExportSettings exportsettings = new();
exportsettings.AutoPrintMode = Stimulsoft.Report.Export.StiPdfAutoPrintMode.Silent;
StiReport report = new StiReport();
. . .
report.Render(true);
StiReportResponse.PrintAsPdf(report);

PDF is OK in browser window.
When I download it clicked on Download icon: "Network error".
Should I set anything? Or what is the solution?

Thank you
Attila
Jose
Posts: 16
Joined: Thu Oct 17, 2019 8:42 am

Re: Blazor - Download PDF - error

Post by Jose »

Sorry!
This problem is only in Chrome, but in FireFox it's working.
Attila
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Blazor - Download PDF - error

Post by Max Shamanov »

Hello,

Please check the the following link with our Blazor samples:
https://github.com/stimulsoft/Samples-R ... rom%20Code

Thank you,
Jose
Posts: 16
Joined: Thu Oct 17, 2019 8:42 am

Re: Blazor - Download PDF - error

Post by Jose »

Hi!

Thank you for your answer.
I see the sample - it's ok.

But I always must print the pdf in a new browser window: StiReportResponse.PrintAsPdf(report)
1. Then If the user wants to, he clicks on the browser's Download icon and download it.
This works fine in Firefox, but not in Chrome. Why?
2. Or the program print and download pdf all at once.
3. Or the program download it first (StiReportResponse.ResponseAsPdf(report)), then open it immediately.

I try 3. without automatic open (I can't do that). This is faster then print to pdf.

By the way, I use JS for the new window opening:
string url = $"/documentprint..." - this razor generates the report
await jsRuntime.InvokeVoidAsync("open", url, "_blank");

Attila
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Blazor - Download PDF - error

Post by Max Shamanov »

Hello,

Please send us a sample project that reprduce the issue.

Thank you.
Post Reply