How can I use the example as shown here to redirect the ResponseAsPdf() to a MemoryStream?
@page "/"
@using System.Data
@using System.IO
@using Stimulsoft.Base
@using Stimulsoft.Report
@using Stimulsoft.Report.Blazor
@using Stimulsoft.Report.Dictionary
@using Stimulsoft.Report.Web
@inject IJSRuntime JSRuntime
<button @onclick="@OnClickExport">Export Report</button>
@code
{
private StiReport report;
protected override void OnInitialized()
{
StiFontCollection.AddFontFile("Fonts/MicrosoftSansSerif.ttf", "Segoe UI");
base.OnInitialized();
}
private void OnClickExport()
{
StiBlazorHelper.Initialize(JSRuntime);
report = StiReport.CreateNewReport();
report.Load("Reports/Report.mrt");
StiReportResponse.ResponseAsPdf(report);
}
}
Redirecting Response Output
-
- Posts: 14
- Joined: Wed Jun 01, 2022 8:26 am
-
- Posts: 525
- Joined: Tue Sep 07, 2021 10:11 am
Re: Redirecting Response Output
Hello,
You can use the following code for export a rendered report into the stream without dialog using the provider.
You can use the following code for export a rendered report into the stream without dialog using the provider.
Code: Select all
report.Render();
report.ExportDocument(StiExportFormat.Pdf, stream);