Send Report in Pdf to front end from .NET

Stimulsoft Reports.NET discussion
Post Reply
alanguevara
Posts: 3
Joined: Fri Aug 18, 2023 2:17 pm

Send Report in Pdf to front end from .NET

Post by alanguevara »

Hi there,

Is is possible to send back to the viewer a report in PDF format? I want to give user an option to send pdf to one of our services without having to click export or save in the viewer?

I see we can do:

Code: Select all

report.ExportDocument(StiExportFormat.Pdf, "path");
But instead of storing it in a folder I want to be able to store it in a variable and then either send it to the front end or have a method in the backend that can upload that pdf somewhere else.

Thanks,
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Send Report in Pdf to front end from .NET

Post by Lech Kulikowski »

Hello,

It is not possible to open PDF in the viewer. But you can export the report to PDF in your code and then open it where you need.

Thank you.
alanguevara
Posts: 3
Joined: Fri Aug 18, 2023 2:17 pm

Re: Send Report in Pdf to front end from .NET

Post by alanguevara »

Thanks Lech for your quick response. I want to export the report to PDF with code and then and save the PDF file in a variable? I want to later upload that pdf file to different service.

Thanks,
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Send Report in Pdf to front end from .NET

Post by Lech Kulikowski »

Hello,

You can use ExportDocument method and save PDF in the necessary object.

Thank you.
alanguevara
Posts: 3
Joined: Fri Aug 18, 2023 2:17 pm

Re: Send Report in Pdf to front end from .NET

Post by alanguevara »

Can you share an example on how to do it? Based on the ExportDocument method and examples I can only see how to store it in the path pass as argument.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Send Report in Pdf to front end from .NET

Post by Lech Kulikowski »

Hello,

You can use Stream in the ExportDocument method.

Thank you.
Post Reply