gpt4 book ai didi

angular - Stimulsoft - 如何在 asp.net core 中渲染报告并以 Angular 显示

转载 作者:行者123 更新时间:2023-12-02 15:59:24 25 4
gpt4 key购买 nike

Stimulsoft report:

如何在 asp.net core 中渲染包含变量和参数的报告并以 Angular 显示?

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 核心:

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);
}

如何在此方法中准备报告以正确显示 Angular ?

最佳答案

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 方法的结果使用到组件中

Angular 分量:

this.report.load("result of GetReport method");

关于angular - Stimulsoft - 如何在 asp.net core 中渲染报告并以 Angular 显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54087229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com