我有一个我建立的网站,它适用于 IE8/IE9、Chrome 和 FireFox 中的每个人。但是,现在我的客户要求它也可以在 IE7 中工作,因为那里的机器仍然有 IE7。我无法弄清楚 ReportViewer 控件出了什么问题。任何帮助,将不胜感激。
问题是我的报告超出了设定的高度和宽度;它不会停留在我使用 jQuery 将其包裹起来的 DIV 中
jQuery 代码
$(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');
});
内容
<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 代码}
<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>