1

我曾尝试StimulSoftReport在 MVC 5 中使用。我在 stimulsoft 设计器中设计了一个 .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);
        }

什么事 ?:(

4

3 回答 3

1

我通过将这部分代码添加到 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>
于 2020-05-05T09:37:59.533 回答
0

您不会将数据传递给报告。只有架构。通常 DataSet 是用 RegData() 方法注册的。

于 2015-05-12T11:06:46.910 回答
0

不知道能不能解决你的问题?但我最近遇到了和你一样的问题,我正在使用 mvc 5.2.3,我用谷歌搜索但找不到合适的解决方案,所以我猜它需要更改 .dll 版本。我将 dll 更改为 Stimulsoft.Suite.2015.2.Retail 并且问题已得到修复。

希望这对您有所帮助。

于 2016-04-16T06:26:52.827 回答