SQL Reporting Services Report Viewer Scroll Bar(RDLC)
把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>
------------------
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY