【问题标题】:How to send parameters to Stimulsoft Report in Asp.Net Core 2.0?如何在 Asp.Net Core 2.0 中向 Stimulsoft Report 发送参数?
【发布时间】:2019-07-10 18:52:31
【问题描述】:

我使用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 Core 2.0 版

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

请帮帮我。

谢谢。

【问题讨论】:

    标签: asp.net-core .net-core stimulsoft


    【解决方案1】:

    哇!!!

    解决了。

    我应该使用Value 而不是ParameterValue

    如下:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-24
      • 1970-01-01
      • 2023-01-31
      相关资源
      最近更新 更多