gpt4 book ai didi

c# - 如何将参数发送到 Stimulsoft?

转载 作者:太空狗 更新时间:2023-10-29 17:43:24 25 4
gpt4 key购买 nike

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

我有存储过程并在设计器中执行但我没有向它发送参数以及何时运行应用程序,出现以下错误:

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

我该怎么办?

最佳答案

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

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

}

关于c# - 如何将参数发送到 Stimulsoft?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19615604/

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