Set up the report viewer in .NET 8.0, load a template, and connect the component to the application.

Adding the viewer to a view. Use the @Html.StiNetCoreViewer helper and pass a StiNetCoreViewerOptions object that names the actions the viewer should call:
@using Stimulsoft.Report.Mvc;

@Html.StiNetCoreViewer(new StiNetCoreViewerOptions()
{
    Actions =
    {
        GetReport = "GetReport",
        ViewerEvent = "ViewerEvent"
    }
})

Serving the report from the controller. The GetReport action loads a template and returns it to the viewer; ViewerEvent handles interactive requests:
public IActionResult GetReport()
{
    var report = new StiReport();
    report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"));
    return StiNetCoreViewer.GetReportResult(this, report);
}

public IActionResult ViewerEvent()
{
    return StiNetCoreViewer.ViewerEventResult(this);
}

StiNetCoreHelper.MapPath resolves a path inside the project. The viewer requests the report on load, renders it in the browser, and routes every further interaction (paging, zoom, export) back to these actions.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.