Stimulsoft-如何在asp.net核心中呈现报告并以角度显示 [英] Stimulsoft - How to render report in asp.net core and show it in angular
本文介绍了Stimulsoft-如何在asp.net核心中呈现报告并以角度显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net核心中呈现带有变量和参数的报表并以角度显示?
How can I render the report with its variables and parameters in asp.net core and show it in angular?
角度:
viewer: any = new Stimulsoft.Viewer.StiViewer(null, 'StiViewer', false);
report: any = new Stimulsoft.Report.StiReport();
this.report.load("the report get from my api"); // ???
this.viewer.report = this.report;
this.viewer.renderHtml('viewer');
Asp.net核心:
Asp.net core:
public async Task<IActionResult> GetReport()
{
StiReport report = new StiReport();
report.Load(@"D:\myreport.mrt"); // for example load it from local
// set parameters and variables here.it's ok
// this return does not prepare report for showing in angular.It uses for view of action
return StiNetCoreViewer.GetReportResult(this, report);
}
如何使用此方法准备报告以正确显示角度?
How do I prepare report in this method for showing correctly in angular?
推荐答案
Asp.net核心:
Asp.net core:
public async Task<IActionResult> GetReport()
{
StiReport report = new StiReport();
report.Load(@"D:\myreport.mrt");
// set parameters and variables here.it's ok
// render the report
report.Render(false);
return report.SaveDocumentJsonToString();
// OR return report.SaveDocumentToString();
}
因此我们将GetReport方法的结果用于组件
So we use the result of GetReport method into component
角度组件:
this.report.load("result of GetReport method");
这篇关于Stimulsoft-如何在asp.net核心中呈现报告并以角度显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文