Asp.net mvc 5 未在MVC视图中加载Stimulsoft报告
我曾尝试在MVC5中使用Asp.net mvc 5 未在MVC视图中加载Stimulsoft报告,asp.net-mvc-5,stimulsoft,Asp.net Mvc 5,Stimulsoft,我曾尝试在MVC5中使用StimulSoftReport。我在stimulsoft designer中设计了一个.mrt文件。我有一个可以打印报告的视图。 此视图文件包含以下代码: @using Stimulsoft.Report.Mvc; @{ ViewBag.Title = "چاپ قبض"; Layout = null; } @Html.Stimulsoft().StiMvcViewer( "MvcViewerReport", new Stimulsoft.Report.
StimulSoftReport
。我在stimulsoft designer中设计了一个.mrt文件。我有一个可以打印报告的视图。
此视图文件包含以下代码:
@using Stimulsoft.Report.Mvc;
@{
ViewBag.Title = "چاپ قبض";
Layout = null;
}
@Html.Stimulsoft().StiMvcViewer(
"MvcViewerReport",
new Stimulsoft.Report.Mvc.StiMvcViewerOptions()
{
ActionGetReportSnapshot = "GetReportSnapshot",
ActionViewerEvent = "ViewerEvent"
})
打印操作与GetReportSnapshot
和ViewerEvent
位于同一控制器中。但当显示打印视图时。它只有报表查看器的工具栏,即使我创建了一个断点,也没有显示我的记者,我发现上面的操作都没有从视图中调用
以下是GetReportSnapshot
的代码:
public ActionResult GetReportSnapshot()
{
DataSet dataset = new DataSet();
dataset.ReadXmlSchema(Server.MapPath("~/Content/report/BillXmlFile.xsd"));
StiReport report = new StiReport();
report.Load(Server.MapPath("~/Content/report/Report.mrt"));
report.Dictionary.ImportXMLSchema(dataset);
report.Compile();
return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);
}
下面是ViewerEvent
代码:
public ActionResult ViewerEvent()
{
return StiMvcViewer.ViewerEventResult(HttpContext);
}
怎么了(您不向报表传递数据。只有模式。通常数据集是用RegData()方法注册的。我不知道您是否能解决您的问题?但我最近遇到了与您相同的问题,我正在使用mvc 5.2.3,我在谷歌上搜索,但找不到合适的解决方案,所以我猜它需要更改.dll版本。 我将dll更改为Stimulsoft.Suite.2015.2。零售和问题已修复
希望这对您有所帮助。我的问题可以通过将这部分代码添加到web.config上的assemblyBinding标记来解决
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="2.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>