مشخصات مقاله
-
0
-
0.0
-
1659
-
0
-
0
آموزش نمایش گزارشات در Stimul Soft
آموزش نمایش گزارشات در Stimul Soft
برای نمایش گزارش، باید StiNetCoreViewer component را به صفحه اضافه کنید و property های لازم را روی آن مقداردهی کنید. و در view controller متد مورد نیاز را مشخص کنید.
Index.cshtml
...
@Html.StiNetCoreViewer(new StiNetCoreViewerOptions() {
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent"
}
})
...
HomeController.cs
...
public IActionResult GetReport()
{
StiReport report = new StiReport();
report.Load(StiNetCoreHelper.MapPath(this, "Reports/SimpleList.mrt"));
return StiNetCoreViewer.GetReportResult(this, report);
}
public IActionResult ViewerEvent()
{
return StiNetCoreViewer.ViewerEventResult(this);
}
...در مثال بالا، اجرای دو action از viewer مشخص شده است. GetReport action گزارش آماده برای پیش نمایش را برمی گرداند و ViewerEvent action رویدادهای viewer را handle می کند.
افزودن ViewerEvent action اجباری است. بدون آن انجام عملیات روی viewer امکان پذیر نیست.
اگر گزارش قبل از نمایش render نشده باشد، HTML5 Viewer component آن را به طور خودکار render می کند. می توانید از report template ها و گزارشات render شده برای نمایش گزارش استفاده کنید.
HomeController.cs
...
public IActionResult GetReport()
{
StiReport report = new StiReport();
report.LoadDocument(StiNetCoreHelper.MapPath(this, "Reports/SimpleList.mdc"));
return StiNetCoreViewer.GetReportResult(this, report);
}
...
1398/07/08
1659
0