Reputation: 241
Here are the both exception and the inner exception messages plus stack trace. This is works really fine when I run with visual studio. I have used ReportViewerForMvc and installed via Nuget. So I do have all the .dll referenced. Only issue is it is not working once I hosted with unoeuro.
Exception of type 'System.Web.HttpUnhandledException' was thrown.
at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.reportviewerwebform_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) An error occurred during local report processing.at Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
at Microsoft.Reporting.WebForms.LocalReport.GetParameters() at ReportViewerForMvc.ReportViewerExtensions.SetProperties(LocalReport localReport, LocalReport properties) at ReportViewerForMvc.ReportViewerExtensions.SetProperties(ReportViewer reportViewer, ReportViewer properties) at ReportViewerForMvc.ReportViewerWebForm.BuildReportViewer() at ReportViewerForMvc.ReportViewerWebForm.Page_Load(Object sender, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Please help me to solve this. I have already gone through many threads but couldn't find a solution
Upvotes: 0
Views: 1416
Reputation: 5847
Without really knowing what the cause is, I can guess what it could be. It's possible that the RDLC Report File (e.g. MyReport.rdlc
) was not properly deployed to target environment, or doesn't reside in the expected folder (relative paths) when the executing directory changes.
In Visual Studio, ensure that Copy to Output Directory
Property is set to Copy if newer/always
, and when executing on IIS, the Files could appear within \bin
directory, while locally, they're probably within bin\Debug
.
When passing in the File name of MyReport.rdlc
, in our application, we make it configurable and construct the path like this:
var rdlcFullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConfigurationManager.AppSettings["ReportingPath"], "MyReport.rdlc");
In the web.config
file, add the Path setting:
<add key="ReportingPath" value="bin\Reports" />
You can override the setting for every environment to match the target structure.
Upvotes: 1