Page 1 of 1

Blazor - Download PDF - error

Posted: Thu Jun 01, 2023 1:59 pm
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

Re: Blazor - Download PDF - error

Posted: Thu Jun 01, 2023 2:05 pm
by Jose
Sorry!
This problem is only in Chrome, but in FireFox it's working.
Attila

Re: Blazor - Download PDF - error

Posted: Thu Jun 01, 2023 7:30 pm
by Max Shamanov
Hello,

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

Thank you,

Re: Blazor - Download PDF - error

Posted: Fri Jun 02, 2023 7:17 am
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

Re: Blazor - Download PDF - error

Posted: Fri Jun 02, 2023 7:55 am
by Max Shamanov
Hello,

Please send us a sample project that reprduce the issue.

Thank you.