سلام
من کد زیر را نوشته ام
@using Stimulsoft.Report.Mvc@{ ViewBag.Title = "Contact";} @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions(){ Localization = "~/content/reports/fa.xml", Actions = { GetReportSnapshot = "LoadReportSnapshot", ViewerEvent = "ViewerEvent", ExportReport = "ExportReport", PrintReport = "PrintReport" }})
public ActionResult LoadReportSnapshot() { var testChartOnes=new List<TestChartOne>(); testChartOnes.AddRange(new List<TestChartOne> { new TestChartOne{Name = "D",Count = 2}, new TestChartOne{Name = "I",Count = 17}, new TestChartOne{Name = "S",Count = 10}, new TestChartOne{Name = "C",Count = 24}, }); var report = new StiReport(); report.Load(Server.MapPath("~/Reports/DI980318.mrt")); report.RegBusinessObject("db", testChartOnes); report.Dictionary.Variables.Add("DatePer", "1397/01/01"); return StiMvcViewer.GetReportSnapshotResult(HttpContext, report); } public virtual ActionResult ViewerEvent() { return StiMvcViewer.ViewerEventResult(); } public virtual ActionResult PrintReport() { return StiMvcViewer.PrintReportResult(this.HttpContext); } public virtual ActionResult ExportReport() { return StiMvcViewer.ExportReportResult(); }
با سلام خدمت شما
شما در خط 29 باید مثل variable عمل کنید یعنی اسم business object باید با businessObject در گزارش ساز یکی باشد.
مثال:
report.RegBusinessObject("dt", testChartOnes);
هیچ کاربری تا کنون از این پست تشکر نکرده است
با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)