我怎样才能使与它的变量和参数在asp.net核报告,并将其显示角度?
角度:
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核心:
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);
}
如何在这种方法正确显示的角度准备报告?
您是否尝试过建立同样的例子: https://www.stimulsoft.com/en/documentation/online/programming-manual/reports_js_binding_data.htm。
更新: 我做了这样的事情之前,我去的是让客户打开请求特定的MVC行动将生成报告的弹出窗口。 另一个想法是生成PDF和使用PDF查看器在客户端上显示你已经生成的内容。
Asp.net核心:
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方法到组件的结果
角度成分:
this.report.load("result of GetReport method");