SQL Reporting Services Report Viewer Scroll Bar(RDLC)

本文探讨了ReportViewer控件在IE7浏览器中显示不正确的滚动条问题。提出了几种解决方案,包括通过调整样式属性来恢复垂直滚动条,以及使用div包裹控件的方法来同时解决水平和垂直滚动条的问题。

把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>

------------------

http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/ebaa0144-7eb0-47a6-95dd-348f76cdcc2b

转载于:https://www.cnblogs.com/emanlee/archive/2009/08/18/1549216.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值