我正在尝试在我的MVC 5.2应用程序中使用Stimulsoft Reports 2014.3。 当我尝试使用@Html.Stimulsoft().StiMvcViewer时,出现以下异常。
mscorlib.dll中发生类型'System.ArgumentNullException'的异常
值不能为空。 参数名称:键
我可以使用@Html.Stimulsoft().StiMvcViewerFx很好。 我尝试了web.config中的各种更改来解决此异常,但是它们都没有用。 我还尝试了Debug-> Exceptions,并选中了两个复选框以查看Common Language Runtime Exception,但是没有其他异常。
添加@Html.Stimulsoft().RenderMvcViewerScripts()都没有用。
这是视图:
@using Stimulsoft.Report.Mvc
@using System.Web.UI.WebControls
@model Models.GenericReportViewModel
@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
ActionGetReportSnapshot = string.Concat("LoadReport?Id=", Model.ReportName),
Width = Unit.Point(500),
Theme = StiTheme.Default,
ActionExportReport = "ExportReport",
Height = Unit.Point(400),
Controller = "Report",
})
这是web.config:
我应该注意,Flash版本的工作方式如下,并且没有任何问题:
@using Stimulsoft.Report.Mvc
@using System.Web.UI.WebControls
@model Models.GenericReportViewModel
@Html.Stimulsoft().RenderMvcViewerFxScripts()
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions()
{
ActionGetReportSnapshot = string.Concat("LoadReport?Id=", Model.ReportName),
Width = Unit.Point(500),
Theme = StiMvcViewerFxOptions.Themes.Blue,
ActionExportReport = "ExportReport",
BackgroundColor = System.Drawing.Color.Silver,
ActionGetLocalization = "GetLocal",
Height = Unit.Point(400),
Controller = "Report",
})
建议将以下bindingRedirect添加到web.config
添加此选项将抑制异常并阻止呈现页面,这可能是因为我没有使用MVC 3! 但是它应该与此有关。
我也有这个重定向,如oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" ,但是我将获得与此异常的信息。