如何在 Asp.Net Core 2.0 中向 Stimulsoft Report 发送参数?

How to send parameters to Stimulsoft Report in Asp.Net Core 2.0?

我使用 Asp.net Core 2.0 Web 应用程序。

我有一个简单的 stimulsoft 报告文件。

我的报告有一个 parameter 称为 @ID

如果我使用不带参数的报告,它运行良好,但是当我向报告发送参数时,它不起作用并且报告加载为空。

我的密码是:

var _Report = new Stimulsoft.Report.StiReport();
_Report.Load(@"C:\temp\report.mrt"); // load report
((StiSqlDatabase)_Report.Dictionary.Databases["Connection"]).ConnectionString = "new connectionString "; // change connection 
_Report.DataSources["DataSource1"].Parameters["@ID"].ParameterValue = 5171; // set parameter value   
_Report.Render();

注意:我用的是Asp.net核心版本2.0.

此代码在 asp.net 中运行良好。

请帮助我。

谢谢。

哇!!!

已解决。

我应该使用 Value 而不是 ParameterValue.

如下所示:

_Report.DataSources["DataSource1"].Parameters["@ID"].Value = 5171;