SQL Server 2005 Reporting Services ReportViewer Control and IE7

I’ve spent the last few days pulling my hair out over an issue with my reports rendering correctly inside and ASP.Net page and IE7. Like many companies we are preparing to roll out Internet Explorer 7 to all of the desktops. As part of that we’re doing regression testing on our applications, and in doing my tests uncovered an issue with IE7 and our BI (Business Intelligence) solution. It is an ASP.Net 2.0 page that uses the Report Viewer control to display SQL Server 2005 Reporting Services reports.

In IE6, everything has been running fine, reports rendering correctly and users happy. In testing for IE7, we found the reports only drew enough to fill up the available space inside the browser, and then stopped. No scroll bars, and if you resized the browser it did not paint the interior correctly.

The solution, as it turns out was pretty obscure. A co-worker found a thread at http://www.eggheadcafe.com/software/aspnet/27965101/re-problems-setting-webf.aspx that put me on the correct track. The solution needed three minor tweaks to our code.

First, you need to remove the DOCTYPE line from your aspx page. Yes, that’s correct, the line that is automatically inserted when you create a new page. It should look like:

<!DOCTYPE html PUBLIC “~//W3C//DTD XHTML 1.0 Transitional//EN” "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Find it and delete it.

Next, on the ReportViewer control, make sure the AsyncRendering property is set to False. When you set it to true (the default) the report did render correctly, but instead of using the entire webpage to scroll it put another scroll bar onto the report viewer itself, and you had to use it to move through your report. Our testing found having two scroll bars (one for the page and one for the report) to be a bit confusing to the users. Try it both ways though and see what works best for you, as your mileage may vary. For us, we went with False as the setting.

In examining the AsyncRendering property, I found this article on MSDN which further confirmed the need to remove the DocType: http://msdn2.microsoft.com/en-us/library/ms252090(VS.80).aspx

In the final tweak, I made sure to set the width of the ReportViewer control to 100% and removed any setting of height. This allowed the page to scale automatically to the size it needed to be.

Since this was not an intuitive fix, I’m hoping getting the word out will help others and save them the two weeks of frustration I went through.

Advertisement

53 thoughts on “SQL Server 2005 Reporting Services ReportViewer Control and IE7

  1. Great post. We implemented SQL Report Services last year in and were amazed at how well we adapted to it.

    But despite its good aspects it has those weird failings that are near show stoppers like the “Select All” parameter problem that was in version 1.0, fixed one way in the next release with no real announcement. We had gone to the trouble to rig our stored procedures for the work around in 1.0 to only have to undo it with the patched version.

    Thanks for the post – this will prep for our IE upgrade.

  2. lakshmi – do you have a max height property set on the report viewer control? If so that may be the problem, remove it and just leave it blank.

    Arcane

  3. lakshmi I assume you mean layout section for your control. If so the height is the problem, remove the 450px. Actually you should probably remove all your fixed height / width settings and let the browser size it for you.

    Follow my instructions in the post and it should take care of the issue.

  4. got it fixed partially…if i use asynredenring to false .. it becomes difficult to move within reports by passign multiple weeks as parameter within the same aspx page. but wen i set it to true the above issue issue is solved but i get 2 scroll bars. so i hav my reports very small on pages now

    plzzz help me i hav a demo on monday

  5. Hi,
    I have Master Pages, in which i have DOC tag, and it has banners. I have deleted them.Also I have added the AsyncRendering as false and have given the height and width too.. Now am getting two Scroll bars for each Horizontal and Vertical., one pair for the report and other for the banner and the rest background..which is a bad designing.confused totally.Please make it clear for me.Please help me.

  6. Hi,

    I am using Report Viewer control to show SSRS reports on my web page. I implemented Asynchronous rendering and I am facing the issue of 2 scrollbars for each Horizontal and vertical scrollbar.

    plzzz help me in implementing Asynchronous rendering..

  7. hi, is der a way in SSRS to display the label on graph only when mouse is moved on the line graph’s point. should remain hidden otherwise on the line graph. shldnt make the graph look clumsy with all label points getting displayed at a time.

  8. Hi, i’m not sure if this is a problem related to IE7 or if it’s being caused by something else. I can view my report within the ReportServer reports directory by browsing. However, when i try to display the report in a ReportViewer control, the entire control appears blank. The space is still occupied but nothing seems to be rendered within this blank space (not even the toolbar or scrollbars).

    I am quite certain that the control is connecting with the report (rdl) on the server successfully but not sure where to go from here. Any advice would be greatly appreciated. Thanks.

  9. Looks like i was able to resolve this problem. It turns out that i had the ShowCredentialsPrompt attribute set to false and was therefore unable to view the report. After setting this attribute to true, I was able to enter the datasource credentials (SQL Server login) and access the report.

  10. Jason,

    This is probably happening because your datasources on Report Server are set to use a Trusted Connection. When browsing through the web, especially when your site allows Anonymous User access, you usually won’t have the right credentials to access SQL Server.
    To prevent the Windows Security prompt from appearing, go into Report Services manager through SQL Server Management Studio and set the datasources for your report to use a SQL login instead of Windows Security. Then your report can access it’s data and you won’t have to type your credentials in all the time.
    You may also need to set up the BUILTIN\Users group to have browser privileges on the Report Server. If the report server is on another machine than the web server, you will have to do a bit more work
    HTH

  11. What are the implications of removing the doctype from the header? Will this cause other issues? Just wondering…

  12. Please remove height and width for reportViewer. Then
    with using javascript function on “onload” for the form in which we have ReportViewer to set the height and width for ReportViewer.

  13. Guys, this isn’t an issue with ie7, its an issue with ie6. ie6 runs in “quirks mode” by default. adding the transitional dtd to the header will force the browser into “standards mode” which causes the browser to interpret the css standards quite a bit differently, therefore render incorrectly. this issue is with the code being generated by srrs. your solution in any “real” web environment would remove the strict parsing of css and immediately defeat any standards effort being made.

  14. Thanks Robert Cain for the original post, this one has helped me out. Unfortunately the fix only works in IE, for in Firefox the reportviewer does not expand to occupy the entire height. Any suggestions?

    @ic0n : I don’t believe the problem is specific to IE6, I experienced the same thing in IE7.

    @Sreekanth : I tried using jquery to adjust the reportviewer height on page load, however this didn’t have the desired result, as the report parameters would push the page down, resulting in the dreaded double scrollbar. Here’s the code I tried:

    $(“#ReportViewer1”).css(“height”, $(window).height());

  15. Thank you so much! It cost me two whole days to try to figure this out and I almost killed myself—because everything was working perfectly until two days ago I updated my system.

    Now I could have a good rest on the weekend!

  16. I am also facing the same thing as asked by Arvind. Progress icon when asnc mode is set to false.
    In addition to this the multivalue parameter dropdown is not displayed aligned with the dropdown box where as the same is displayed somewhere in middle of the report viewer.
    Please help me out in these issues.
    Thanks in advance.
    Ritesh

  17. Hi all,
    i am using reporting services first time,
    i developed some reports and published them to our db server,which is seperate from application server.
    the problem is i am getting error when invoking from application server.
    plz help me
    thanks in advance.

  18. Satya, I’ll bet you have a security issue. Your report server is probably not setup correctly to recognize the application server as an authorized user of the report.

    Ram, need more details before we can help.

    To the other guys not sure about progress icon, will have to play around with that.

  19. Hi All,

    I want to do my backup procedure automate by creating sql job and want to store in a Folder.
    This process I have to do daily twice but my problem is its executing successfully for first time but for second time
    its saying that the given jobname aleady exists.
    SO how i can dynamically change backup file name and job name.
    or else is there any other way for taking backup in recurring process by executing single job.
    plz help ASAP
    thanks in advance

    Regards
    Satya

  20. Hi arcanecode,

    When I set the AsyncRendering property to False, the ReportViewer control displays some css rendering text just above the SSRS report (I’m using remote mode). When I change the property back to True, the css text disappears.

    Thanks.

  21. Ok, so what about this problem… I have a report viewer on a asp.net 2.0 page. This page uses a master page which contains: “”.

    I am having this problem where the control it taking up the page appropriately, however, the report is not taking up the control. The report seems to only put 20 characters to a line. If you export the report, it looks fine, it is just in the display inside the report viewer.

  22. dear friends,
    I have found a solution to this issue of report viewer control when you set the asynch rendering property to true. Infact when I used the control in my page it showed some weird behaviour. I used two controls in a tr, and the page just got a scroll bar and the page width increased to the length of the report. So I just checked out the rendered html and found that the rendered HTML was not proper, it had many divs and tables. Then I applied the “table-layout=fixed” property to the containing div, and voila it worked. 🙂

  23. Hi,
    Am using Reportviewer control I had 2 scroll bars one for reportviewer and another one for broweser ,
    to overcome tat i mentioned for asynchronous rendering now the scroll bars gone,
    but due to tat when we click view report loading images is not displayed and header part of the report alignment is totally changed in only in IE7

  24. Thanks A Million!!! I was not able to deliver my reports because of the scrollbar and we had revised client deadline by 3 days because of it… This post was a life-savor

  25. I want to display a parameter value in the report…..
    The value id showing in Reporting Service…. but its not showing in web page….. What to do for that…..

  26. Has microsoft lauched new plugins or patches for sql server 2005 reporting services to resolve the horizontal bar problem in IE 7 as it works great in IE6? Please help as I have tons of pages to change, as too many pages involves reportviewer control in my application.

    Thanks for your help in advance.

  27. no need to remove doctype and set asyncrendering thing. just add the following code in your code behind.

    reportviewerid.Style.Add(“margin-bottom”,”30px”);
    it resolves your problem in IE7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s