Showing a Report as PDF
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.Instead of downloading, an exported PDF can be shown inline in the browser — render the report, export to a PDF blob, and open it in a new tab.
Render, then export to a PDF blob.
How it works. The PDF is produced entirely client-side and shown from a blob URL, so no server round-trip or file download is required.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Render, then export to a PDF blob.
var report = new Stimulsoft.Report.StiReport();
report.loadFile("../reports/SimpleList.mrt");
report.renderAsync2();
function saveReportPdf() {
report.exportDocumentAsync(function (pdfData) {
var blob = new Blob([new Uint8Array(pdfData)], { type: "application/pdf" });
window.open(URL.createObjectURL(blob));
}, Stimulsoft.Report.StiExportFormat.Pdf);
}exportDocumentAsync(callback, StiExportFormat.Pdf)— renders to PDF bytes and hands them to the callback.new Blob(...)+URL.createObjectURL— wrap the bytes as a blob and open them in a browser tab.
How it works. The PDF is produced entirely client-side and shown from a blob URL, so no server round-trip or file download is required.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
