把ReportViewer 放到UpdatePanel之外,并且放到div之中,设置绝对高度和宽度。
ReportViewer scrollbars are not rendered correctly in IE7. The Vertical
scrollbar can be recovered and the bottom part of the report can be viewed if you add the folowing to your page:
string userAgent = Request.ServerVariables.Get("HTTP_USER_AGENT");
if(userAgent.Contains("MSIE 7.0"))
vwrReports.Attributes.Add("style", "margin-bottom: 30px;");
郁闷啊, 没有水平的滚动条, 在网上查了下, 发现了些solution:
1. Use vwrReports.Attributes.Add("style", "overflow:auto;");
2. Downgrade the ReportViewer control from its earliest version with ns:
Microsoft.Samples.ReportingServices.
不知道博客园的各位老大有没有好的解决方法。第一个我已经试过了,不可以。第二个没有试。
------------------
Add a third person to the list that's encountered the problem. I've tried setting the height property to 100% of the available space, but then the vertical scrollbar gets cutoff. The other odd thing I've noticed is that when I set the height property, the outer shell of the control renders as a table instead of as a div, which is what it normally is rendered as. So far the only workaround I've found is to add 50 pixel margin between the control and what I'm putting the control in (a table in this case).
rvReport.Attribute.Add("style", "margin-bottom: 50px;")
Unfortunetly, this leaves 50pixels of empty space in IE6, so it isn't ideal. If there is a better solution, or an explanation to the problem, let me know!
------------------
Spector's solution works pretty well, just a minor tweak so that IE6 and Firefox don't have to pay for IE7's incompatability...
Code Snippet
string userAgent = Request.ServerVariables.Get("HTTP_USER_AGENT");
if(userAgent.Contains("MSIE 7.0"))
vwrReports.Attributes.Add("style", "margin-bottom: 30px;");
------------------
Wrap the control in DIV tag. This solved the Horizontal and vertical scroll bar problem for me in IE 7. Though the width of the report control is 900px, it takes the width of the table.
<TABLE WIDTH="YOUR WIDTH HERE"> <TR> <TD>
<div >
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt"
Height="600px" Visible=False Width="900px" SizeToReportContent="True" >
<LocalReport ReportPath="XYZ.rdlc">
</LocalReport>
</rsweb:ReportViewer>
</div>
</td>
</tr>
</table>
------------------