The viewer can be driven from your application through a properties object — for instance to switch which report is shown at run time.

Read the properties and load the chosen report.
public IActionResult GetReport()
{
    var reportName = "MasterDetail.mrt";

    var httpContext = new Stimulsoft.System.Web.HttpContext(this.HttpContext);
    var properties = httpContext.Request.Params["properties"]?.ToString();
    if (properties != null)
    {
        var json = Encoding.UTF8.GetString(Convert.FromBase64String(properties));
        var jsonObject = JsonConvert.DeserializeObject(json) as JToken;
        reportName = jsonObject["reportName"]?.ToString() ?? reportName;
    }

    var report = StiReport.CreateNewReport();
    report.Load(StiReactHelper.MapPath(this, $"Reports/{reportName}"));
    return StiReactViewer.GetReportResult(this, report);
}

How it works. The React component passes properties with each request, so the controller can vary the report it returns without new endpoints.

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.