This example renders a report and exports it to HTML — either receiving the HTML string for display in the page, or saving it as a file.

Exporting the document. Load and render the report, configure the requested export format, and deliver the generated bytes as a file, stream, or web response.
var report = new Stimulsoft.Report.StiReport();
report.loadFile("../reports/SimpleList.mrt");
report.renderAsync(function () { });

function saveReportHtml() {
    report.exportDocumentAsync(function (htmlString) {
        var fileName = report.reportAlias;
        Stimulsoft.System.StiObject.saveAs(htmlString, fileName + ".html", "text/html;charset=utf-8");
    }, Stimulsoft.Report.StiExportFormat.Html);
}
The export callback receives the HTML as a string, which you can insert into the page or, as here, download as a file. Passing a different StiExportFormat value exports to PDF, Excel, Word and other formats with the same call.
Auf dem Screenshot unten Sie können das Ergebnis des Beispiel-Codes ansehen:

Exporting a Report to HTML

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.