Mor*_*emi 2 stimulsoft asp.net-core angular
如何在 asp.net core 中使用其变量和参数呈现报告并以角度显示?
角度:
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');
Run Code Online (Sandbox Code Playgroud)
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);
}
Run Code Online (Sandbox Code Playgroud)
如何以这种方法准备报告以正确显示角度?
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();
}
Run Code Online (Sandbox Code Playgroud)
所以我们使用GetReport方法的结果到组件中
角度组件:
this.report.load("result of GetReport method");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2618 次 |
| 最近记录: |