问题
iam use mvc5.2 and stimulsoft 2014.3 when run this see error: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key
Source Error:
Line 7: Line 8:
@Html.Stimulsoft().RenderMvcViewerScripts() Line 9:
@Html.Stimulsoft().StiMvcViewer("MyViewr", new StiMvcViewerOptions() Line 10: { Line 11: ActionGetReportSnapshot = "FromLoadFileReport",
@Html.Stimulsoft().StiMvcViewer("MyViewr", new StiMvcViewerOptions()
{
ActionGetReportSnapshot = "FromLoadFileReport",
ActionViewerEvent = "ViewerEvent",
Width = Unit.Percentage(100)
//Theme = StiTheme.Office2007Black,
//ActionPrintReport = "PrintReport",
//ActionExportReport = "ExportReport",
//ToolbarBackgroundColor = System.Drawing.Color.Silver
StiReport report = new StiReport();
string Path = Server.MapPath("~" + ("/Web/Areas/RepUser/HistoryJob.mrt"));
report.Load(Path);
report.Compile();
return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);
回答1:
You should add next section in Web.config file:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
回答2:
stimulsoft 2014 Doesn't Support MVC5. you should download Stimulsoft 2015.2.
Stimulsoft Reports.Web 2014.1 This version of the product compatible with .NET Framework 2.0 - 3.5
Stimulsoft Reports.Web 2015.2 Official Release An installation package contains everything to install or uninstall the product and to run the setup user interface. This product compatible with Visual Studio 2010 - 2015 and .NET Framework 4.0 or higher.
https://www.stimulsoft.com/en/downloads/reports-web https://www.stimulsoft.com/en/changes/reports-web?build=2015.2
来源:https://stackoverflow.com/questions/30272387/system-argumentnullexception-value-cannot-be-null-paramete