ReportViewer Control – Height issue

asp.netreporting-servicesreportviewer

In my asp.net application, I am trying to open a particular report. I have the ReportViewer Control set with width of 100% and height of 100%. Now I expect that to mean that the report will take up the entire page. Well to my surprise, it does not. In IE7 while it takes the entire width of the page, it only takes up a small portion of the height. In Firefox, both the width and the height are messed up. I have the browser open up a new page that takes up almost all of the screen. Any ideas?

Thanks!

Best Answer

This is the way I fixed, take a look

<div style="Width:auto;"> 
<form id="form1" runat="server" style="width:100%; height:100%;">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <rsweb:ReportViewer ID="rptViewer" runat="server" Width="100%" Height="100%" AsyncRendering="False" SizeToReportContent="True">
    </rsweb:ReportViewer>
</form></div>

The thing doing the magic is AsyncRendering="False" SizeToReportContent="True" the rest is basic HTML. The report will be displayed as it was designed.

There might be some code extra, but see if it works for you.

Hope it helps