Exporting a Report from Code
Our sample projects and report templates can help you learn the basics of working with our products.A report can be rendered and exported to a file — or streamed to the browser as a download — straight from Blazor code.
Render, then export.
How it works. The prepared report is format-agnostic, so the same render can be saved server-side or pushed to the user as a download.
Render, then export.
var report = new StiReport();
report.Load("Reports/TwoSimpleLists.mrt");
report.Render(false);
// Save to a file...
report.ExportDocument(StiExportFormat.Pdf, exportFilePath);
// ...or stream it to the browser as a download
StiReportResponse.ResponseAsPdf(report);Render(false)— prepare the document without a progress dialog; required before export.ExportDocument(format, path)— write a file;StiReportResponse.ResponseAsPdf/Htmlstreams it to the browser.- Browser download needs
StiBlazorHelper.Initialize(JSRuntime)once inOnInitialized.
How it works. The prepared report is format-agnostic, so the same render can be saved server-side or pushed to the user as a download.