4

I have a report viewer control that show's a dashboard stye report. It has a few charts to give an overview, however when viewing in IE11 the report doesn't render at all and just shows up blank. The underlying stored procedure is being ran as well.

I did some testing and

  • Charts show up in Firefox (Current)
  • Charts show up in Chrome (Current)
  • Charts show up in IE Compatibility Mode.
  • If I use the PDF export feature on my web viewer it's able to convert the original byte stream to the correct PDF with the charts, which meant the report ran properly. The underlying stored procedure only ran once when attempting to display the report initially.

I'm not sure if this is a problem with how IE interacts with the webviewer control.

Update - With the magic of Fiddler, it looks like an error was being eaten and not shown when requesting a blank.gif, this seems to be a place holder for the result gif I believe. The IterationId is missing in the URL. The odd thing is that reviewing the Fiddler trace results for FireFox and Chrome the same error regarding IterationId missing from the URL appears however the charts still show. I'm assuming this is still the issue though.

Request header

GET /Reserved.ReportViewerWebControl.axd?ReportSession=....&Culture=1033
&CultureOverrides=True&UICulture=1033&UICultureOverrides=True
&ReportStack=1&ControlID=...
&OpType=ReportImage&ResourceStreamID=Blank.gif HTTP/1.1

Text Resonse

[HttpHandlerInputException: Missing URL parameter: IterationId]
   Microsoft.Reporting.WebForms.HandlerOperation.GetAndEnsureParam(NameValueCollection urlQuery, String paramName) +104
   Microsoft.Reporting.WebForms.ReportImageOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response) +102
   Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context) +380
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
crackhaus
  • 1,176
  • 1
  • 15
  • 27
  • There is an issue with IE11 VS SSRS. Probably getting latest SP would help. See [here](https://connect.microsoft.com/SQLServer/feedback/details/810527/sql-server-reporting-services-is-not-compatible-with-internet-explorer-11) – SouravA Jan 20 '15 at 17:35
  • I'm going to try this as well, I appreciate the link. – crackhaus Jan 20 '15 at 18:03
  • Confirmed this issue occurs under SQL 2008 R2 SP3 (the final update for that release). – Alex Angas Feb 10 '15 at 04:56

1 Answers1

5

The missing IterationId helped me find similar scenarios. It makes sense that the IterationId would fail in IE11 as in Chrome and Firefox since IE11 introduces itself as a Mozilla client. "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"

Per this article by Devin Steinke on SQL Reporting Services - Viewer broken in Non-IE Browsers

In my Global.asax code behind I append the IterationId parameter only on the request for the ReportViewerWebControl blank.gif. It works in IE11 now and still works in FireFox, Chrome and older versions of IE.

You won't see an exception from fiddler anymore, and the result text displays the retrieval of a GIF, "GIF89a" in my case.

VB.NET:

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
    Dim pathQuery = HttpContext.Current.Request.Url.PathAndQuery
    Dim url = HttpContext.Current.Request.Url.ToString().ToLower()

    If pathQuery.StartsWith("/Reserved.ReportViewerWebControl.axd") And Not url.Contains("iteration") Then

        Dim resourceStreamId = HttpContext.Current.Request.QueryString("ResourceStreamId")

        If IsNothing(resourceStreamId) Then Return

        If resourceStreamId.ToString().Equals("blank.gif", StringComparison.InvariantCultureIgnoreCase) Then
            Context.RewritePath(String.Concat(HttpContext.Current.Request.Url.PathAndQuery, "&IterationId=0"))
        End If

    End If
End Sub

C#:

void Application_BeginRequest(object sender, EventArgs e)
{
    // Bug fix for MS SSRS Blank.gif 500 server error missing parameter IterationId
    // https://connect.microsoft.com/VisualStudio/feedback/details/556989/
    if (HttpContext.Current.Request.Url.PathAndQuery.StartsWith("/Reserved.ReportViewerWebControl.axd") &&
     !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["ResourceStreamID"]) &&
        HttpContext.Current.Request.QueryString["ResourceStreamID"].ToLower().Equals("blank.gif"))
    {
        Context.RewritePath(String.Concat(HttpContext.Current.Request.Url.PathAndQuery, "&IterationId=0"));
    }
}
KyleMit
  • 30,350
  • 66
  • 462
  • 664
crackhaus
  • 1,176
  • 1
  • 15
  • 27
  • Thank you so much for this! For me the 500 error occurred using non-IE browsers as well but they still displayed the graph. Anyway I implemented your `IterationId` fix using a control adapter (in SharePoint and can't tinker with global.asax). Problem resolved! – Alex Angas Feb 19 '15 at 06:24
  • I wish I could up-vote this multiple times! In my case, reports simply would not come back -- it would keep spinning the "Loading..." graphic, only in IE11. I tried many other ideas to solve this problem, but this was the only one that worked. I verified the problem using Fiddler, just as you described. What a head-scratcher! – laughsloudly Jul 16 '15 at 22:07