Set up the report viewer in ASP.NET Core Razor Pages, load a template, and connect the component to the application.

Adding the viewer to a page. On a Razor page, add the @Html.StiNetCoreViewer helper with a StiNetCoreViewerOptions object that names the actions:
@page
@model IndexModel
@using Stimulsoft.Report.Mvc;

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

Serving the report from the page model. In Razor Pages the actions map to handler methods named On<Verb><Action>:
public class IndexModel : PageModel
{
    public IActionResult OnPostGetReport()
    {
        var report = new StiReport();
        report.Load(StiNetCoreHelper.MapPath(this, "Reports/TwoSimpleLists.mrt"));
        return StiNetCoreViewer.GetReportResult(this, report);
    }

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

The viewer requests the report on load and renders it in the browser; the GetReport action maps to the OnPostGetReport handler, and all further interaction returns to the same page model.

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