You do not always need the viewer — in an ASP.NET Core app a report can be printed or exported straight to the HTTP response. Each action loads the report and returns it in a format.

Load the report, then respond in a format.
private StiReport GetReport()
{
    var report = new StiReport();
    report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"));
    return report;
}

public IActionResult ExportPdf() => StiNetCoreReportResponse.ResponseAsPdf(GetReport());
public IActionResult ExportXls() => StiNetCoreReportResponse.ResponseAsXls(GetReport());
public IActionResult PrintPdf()  => StiNetCoreReportResponse.PrintAsPdf(GetReport());

How it works. The loaded report is format-agnostic, so each controller action just picks how to serialize the same document — no viewer required.

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.