This example demonstrates how to show a report as PDF. First, load report template, next, render and export it in PDF:
<script type="text/javascript">
	// Create a new report instance
	var report = new Stimulsoft.Report.StiReport();
	// Load report from url
	report.loadFile("../reports/SimpleList.mrt");
	// Render report
	report.renderAsync();

	// Export report to PDF format and save to file
	function saveReportPdf() {
		// Export to PDF
		report.exportDocumentAsync(function (pdfData) {
			// Create blob data
			var blob = new Blob([new Uint8Array(pdfData)], { type: "application/pdf" });

			if (window.navigator && window.navigator.msSaveOrOpenBlob) {
				// Internet Explorer does not support the output of blob data, only save as PDF file
				var fileName = report.reportAlias;
				window.navigator.msSaveOrOpenBlob(blob, fileName + ".pdf");
			} else {
				// Show the new tab with the blob data
				var fileURL = URL.createObjectURL(blob);
				window.open(fileURL);
			};
		}, Stimulsoft.Report.StiExportFormat.Pdf);
	}
</script>

Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

Showing a Report as PDF

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.