locked
ReportViewer height problem when increasing the ZoomPercent to greater than 100% RRS feed

  • Question

  • Problem: When I increase the Zoom percentage of a report to 150% using the report viewer control, the report expands beyond the borders of the page, instead of expanding its container and increasing the size of the page. In MSIE 8, the effect is that the Web site footer appears in the middle of the report. In MSIE 9 the effect is that the report overlays the Web site header and top navigation area so that the top of the report content area is no longer visible. Changing the zoom back to 100% snaps the report back to its expected size. In this particular report the interactive size is 0, since it is a very long and wide report that I want to display in the Web browser without any paging. 

    Things tried: I've tried experimenting with the interactive size and the reportviewer control height attribute, but those don't seem to have any impact on this. Normally I set the report viewer height to 100%. I've tried a variety of different height properties, but they don't seem to have any impact. The problem goes away when viewing the page in Quirks mode and in MSIE7 compatibility mode, so it is some sort of CSS issue. The problem only appears in Internet Explorer, not Firefox or Chrome.

    Does anyone have any ideas? Thank you.

    VS2010, Report Viewer Control 10, SQL Server 2008 R2

    Wednesday, May 30, 2012 2:43 PM

Answers

  • The zoom feature of the ReportViewer control is implemented as a CSS style of zoom, which is not part of the CSS standard and only worked in Internet Explorer. In IE 8, the zoom attribute will only work if the page is run in IE 7 compatibility mode (or using the IE=EmulateIE7 meta tag) or if the doctype tag is removed. In IE 9, the zoom CSS attribute is deprecated and using the zoom attribute > 100% makes the SSRS reports unusable in MSIE9.

    This is not an ASP.NET or Reporting Services issue. This zoom attribute does not even work in a very simple XHTML example.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html><head><title></title></head>
    <body>
    	<table cellpadding="0" cellspacing="0" style="height:100%;background-color:Green;" border="2px"><tr>
    	<td style="zoom:150%;background-color:red">Zoomed Text<br />Zoomed Text<br />Zoomed Text<br />Zoomed Text<br />Zoomed Text<br />Zoomed Text<br /></td></tr>
    	</table>
    	line<br />line<br />line<br />line<br />
    </body></html>

    Conclusion: the zoom attribute of the report viewer control should not be used.

    • Marked as answer by Mike Yin Tuesday, June 5, 2012 11:37 AM
    Wednesday, May 30, 2012 9:55 PM

All replies

  • Removing the DOCTYPE tag is one possible fix, although I'm not yet sure the full implications of this site-wide change.
    <!DOCTYPE html PUBLIC "-/ww.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    Wednesday, May 30, 2012 6:16 PM
  • The zoom feature of the ReportViewer control is implemented as a CSS style of zoom, which is not part of the CSS standard and only worked in Internet Explorer. In IE 8, the zoom attribute will only work if the page is run in IE 7 compatibility mode (or using the IE=EmulateIE7 meta tag) or if the doctype tag is removed. In IE 9, the zoom CSS attribute is deprecated and using the zoom attribute > 100% makes the SSRS reports unusable in MSIE9.

    This is not an ASP.NET or Reporting Services issue. This zoom attribute does not even work in a very simple XHTML example.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html><head><title></title></head>
    <body>
    	<table cellpadding="0" cellspacing="0" style="height:100%;background-color:Green;" border="2px"><tr>
    	<td style="zoom:150%;background-color:red">Zoomed Text<br />Zoomed Text<br />Zoomed Text<br />Zoomed Text<br />Zoomed Text<br />Zoomed Text<br /></td></tr>
    	</table>
    	line<br />line<br />line<br />line<br />
    </body></html>

    Conclusion: the zoom attribute of the report viewer control should not be used.

    • Marked as answer by Mike Yin Tuesday, June 5, 2012 11:37 AM
    Wednesday, May 30, 2012 9:55 PM
  • Hi usp,

    Sorry for the delay.

    According to your description, I am able to reproduce the issue in my test environment. Actually, the zoom parameter is ignored by versions of Microsoft Internet Explorer earlier than Internet Explorer 5.0 and all non-Microsoft browsers. You are right that the Zoom device information setting for HTML rendering extension is deprecated and it should not be used in new applications. For more information, please see:
    HTML Device Information Settings

    Thanks for your valuable feedback. All the time and efforts you have put into this issue are appreciated. I believe this thread will help more people who face with the same issue.

    Regards,
    Mike Yin

    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback here.

    Tuesday, June 5, 2012 11:37 AM