Error in export to pdf
Posted: Wed May 10, 2017 5:58 am
Hi
Why this code don't work?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Stimulsoft Reports.PHP - JS Report Viewer</title>
<!-- Stimusloft Reports.JS -->
<script src="scripts/stimulsoft.reports.js" type="text/javascript"></script>
<script type="text/javascript">
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/SimpleList.mrt");
report.render();
var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
var service = new Stimulsoft.Report.Export.StiPdfExportService();
var stream = new Stimulsoft.System.IO.MemoryStream();
service.exportTo(report, stream, settings);
var data = stream.toArray();
Object.saveAs(data, "SimpleList.pdf", "application/pdf");
</script>
</head>
<body>
</body>
</html>
Why this code don't work?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Stimulsoft Reports.PHP - JS Report Viewer</title>
<!-- Stimusloft Reports.JS -->
<script src="scripts/stimulsoft.reports.js" type="text/javascript"></script>
<script type="text/javascript">
var report = new Stimulsoft.Report.StiReport();
report.loadFile("reports/SimpleList.mrt");
report.render();
var settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
var service = new Stimulsoft.Report.Export.StiPdfExportService();
var stream = new Stimulsoft.System.IO.MemoryStream();
service.exportTo(report, stream, settings);
var data = stream.toArray();
Object.saveAs(data, "SimpleList.pdf", "application/pdf");
</script>
</head>
<body>
</body>
</html>