Using Designer Events
Our sample projects and report templates can help you learn the basics of working with our products.Stimulsoft for Angular includes a report designer alongside the viewer; this controller serves it and handles its Get and Save actions.
Route designer actions.
How it works. The designer's events are dispatched through the controller, so opening and saving a report are handled on the server.
Route designer actions.
[HttpPost]
public IActionResult Post()
{
var requestParams = StiAngularDesigner.GetRequestParams(this);
if (requestParams.ComponentType == StiComponentType.Designer)
switch (requestParams.Action)
{
case StiAction.GetReport: return GetReport();
case StiAction.SaveReport: return SaveReport();
}
return StiAngularDesigner.ProcessRequestResult(this);
}Get and save the report.public IActionResult GetReport()
{
var report = StiReport.CreateNewReport();
report.Load(StiAngularHelper.MapPath(this, "Reports/SimpleList.mrt"));
return StiAngularDesigner.GetReportResult(this, report);
}
public IActionResult SaveReport()
{
var report = StiAngularDesigner.GetReportObject(this);
report.Save(StiAngularHelper.MapPath(this, "Reports/SimpleList.mrt"));
return StiAngularDesigner.SaveReportResult(this);
}StiAngularDesigner.GetRequestParams+requestParams.Action— dispatch on the designer action (GetReport/SaveReport).GetReportObject(this)+report.Save(path)— receive the edited report on save and persist it.
How it works. The designer's events are dispatched through the controller, so opening and saving a report are handled on the server.