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);
}
I have stored procedure and execute in designer but I do not send parameters to it and when run App, I get the following error:
Error:SqlCommand.Prepare method requires all variable length parameters to have an explicitly set non-zero Size.
What do I do?
My problem was solved with the following code :
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);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With