首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IE7 ReportViewer控件

IE7 ReportViewer控件
EN

Stack Overflow用户
提问于 2011-07-12 12:52:35
回答 1查看 1.4K关注 0票数 3

我有一个网站,我在IE8/IE9、Chrome和FireFox中为每个人建了一个很好的网站。但是,现在我的客户端也要求它在IE7中工作,因为那里的机器仍然有IE7。我不知道ReportViewer控件有什么问题。任何帮助都将不胜感激。

问题是,我的报告超出了设定的高度和宽度;它不停留在我使用jQuery包装的DIV中

jQuery码

代码语言:javascript
复制
 $(document).ready(function () {
            var htmlwidth = $('.main').width() - 20;
            var htmlheight = $(document).height() - $('.header').height() - 45;
            $('#<%= ReportViewer1.ClientID %>').wrap('<div style="overflow:auto;" />');
            $('#<%= ReportViewer1.ClientID %>').parent().css(height, htmlheight);
            $('#<%= ReportViewer1.ClientID %>').parent().css('width', htmlwidth);
            $('#<%= ReportViewer1.ClientID %>').css('width', htmlwidth);
            $('#<%= ReportViewer1.ClientID %>').css(height, htmlheight);
            $('#<%= ReportViewer1.ClientID %>').parent().css('border', 'solid 1px Black');
    });

含量

代码语言:javascript
复制
<asp:ScriptManager ID="scManager" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="100%"  Width="100%"
    SizeToReportContent="true" ZoomMode="Percent" AsyncRendering="false" >
</rsweb:ReportViewer>

示例生成的块{content + jQuery Code}

代码语言:javascript
复制
<div style="width:500px; overflow:auto; border:solid 1px Black;height:400px;">
    <asp:ScriptManager ID="scManager" runat="server"></asp:ScriptManager>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="400px"  Width="500px"
        SizeToReportContent="true" ZoomMode="Percent" AsyncRendering="false" >
    </rsweb:ReportViewer>
</div>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-07-12 12:57:32

看起来您正面临IE7溢出问题。您可以阅读更多关于它的here

若要修复问题,请将外部div设置为具有position: relative

将以下行添加到jQuery中:

代码语言:javascript
复制
$('#<%= ReportViewer1.ClientID %>').parent().css(position, relative);

或将以下内容添加到wrap()中

代码语言:javascript
复制
$('#<%= ReportViewer1.ClientID %>').wrap('<div style="overflow:auto; position:relative;" />');

最后的输出应该如下所示:

代码语言:javascript
复制
<div style="width:500px; overflow:auto; border:solid 1px Black;height:400px; position:relative;">
    <asp:ScriptManager ID="scManager" runat="server"></asp:ScriptManager>
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Height="400px"  Width="500px"
        SizeToReportContent="true" ZoomMode="Percent" AsyncRendering="false" >
    </rsweb:ReportViewer>
</div>
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6664436

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档