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(StiVueHelper.MapPath(this, $"Reports/{reportName}"));
    return StiVueViewer.GetReportResult(this, report);
}

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

Hallo! Brauchen Sie Hilfe?