Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何向Stimulsoft发送参数?_C#_Asp.net Mvc_Stimulsoft - Fatal编程技术网

C# 如何向Stimulsoft发送参数?

C# 如何向Stimulsoft发送参数?,c#,asp.net-mvc,stimulsoft,C#,Asp.net Mvc,Stimulsoft,我在designer中有存储过程和执行,但我不向它发送参数,也不在何时发送 运行应用程序时,我收到以下错误: 错误:SqlCommand.Prepare方法要求所有可变长度参数的大小均显式设置为非零 我该怎么办?在编译报告之前,您可以使用以下代码: public virtual ActionResult GetReportSnapshot() { var data = (ComparativeBalanceReportDS) TempData["Comparativ

我在designer中有存储过程和执行,但我不向它发送参数,也不在何时发送 运行应用程序时,我收到以下错误:

错误:SqlCommand.Prepare方法要求所有可变长度参数的大小均显式设置为非零


我该怎么办?

在编译报告之前,您可以使用以下代码:

    public virtual ActionResult GetReportSnapshot()
    {
       var data = (ComparativeBalanceReportDS) TempData["ComparativeSession"];


        StiReport report = new StiReport();
        report.Load(Server.MapPath("~/Content/StimulReports/SampleReport.mrt"));

        report.Compile();

        report["fromDocumentNumber"] = "1";
        report["toDocumentNumber"] = "85";
        return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);
   }

还可以在参数表达式中使用其他变量。在这种情况下,您应该在呈现报告之前设置变量的值。

我的问题已通过以下代码解决:

report.Dictionary.DataSources["DataSourceName"].Parameters["ParameterName"].Value = ""
       public virtual ActionResult GetReportSnapshot()
        {
         var data = (ComparativeBalanceReportDS) TempData["ComparativeSession"];       
          StiReport report = new StiReport();
         report.Dictionary.DataStore.Clear();
         report.Load(Server.MapPath("~/Content/StimulReports/SampleReport.mrt"));
         report["@enterpriseId"] = data.EnterpriseId;
         report["@toDocumentNumber"] = data.NumberFilter.FromDocumentDocumentNumber;
         report["@fromDocumentNumber"] = data.NumberFilter.ToDocumentDocumentNumber;
         report["@fromDate"] = data.DateFilter.FromDocumentDate.Value;
         report["@toDate"] = data.DateFilter.ToDocumentDate.Value;
         return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);

        }