SQL Reporting Services Report Viewer Scroll Bar(RDLC)
  TnD0WQEygW8e 2023年11月19日 53 0

把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



【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月19日 0

暂无评论

推荐阅读
  cB14ff7Kmzpi   2023年12月19日   34   0   0 iosiosgogoCodeCode
TnD0WQEygW8e