Friday, June 26, 2015

Report Viewer Not Running Local Report in IE11

I was working on a project that ran local SQL Reports using the Report Viewer control. As I was working with the reports, I was only testing in FireFox which was fine, however, I later found that the reports were not running in IE! I was running IE11 at the time. There are numerous fixes for this issue including adding the meta tag (which did not work for me). I selected the modification to the Global.asax file and that corrected the issue.
I am running MVC, .NET Framwork 4
  1. protected void Application_BeginRequest(object sender, System.EventArgs e) {
  2. // Bug fix for MS SSRS Blank.gif 500 server error missing parameter IterationId
  3. // https://connect.microsoft.com/VisualStudio/feedback/details/556989/
  4. if (HttpContext.Current.Request.Url.PathAndQuery.StartsWith("/Reserved.ReportViewerWebControl.axd") &&
  5. !System.String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ResourceStreamID"]) &&
  6. HttpContext.Current.Request.QueryString["ResourceStreamID"].ToLower().Equals("blank.gif"))
  7. {
  8. Context.RewritePath(System.String.Concat(HttpContext.Current.Request.Url.PathAndQuery, "&IterationId=0"));
  9. }
  10. }

No comments:

Post a Comment