【发布时间】:2014-01-07 11:45:38
【问题描述】:
试图让我的报告填满浏览器的屏幕时,我获得了很多“乐趣”。
报表查看器适合屏幕,但基础报表不跟随。
这是我尝试过的:
if (!Page.IsPostBack)
{
List<SchoolViewModel> res = BLL.Reports.ReportMethods.GetSchool();
ReportViewer1.Reset();
ReportViewer1.LocalReport.ReportPath = "Reports/SchoolReport.rdlc";
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("SchoolDS", res));
ReportViewer1.AsyncRendering = false; // Force inline/remove iFrame
ReportViewer1.SizeToReportContent = true; // Fit report to screen
ReportViewer1.ZoomMode = ZoomMode.FullPage;
ReportViewer1.LocalReport.Refresh();
}
还有标记:
<form id="form2" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
Font-Size="8pt" InteractiveDeviceInfos="(Collection)"
WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="100%" style="width:100%;">
<LocalReport ReportPath="Reports\SchoolReport.rdlc"></LocalReport>
</rsweb:ReportViewer>
<div class="backButtonWrapper">
<a id="backButton" href="../home">Go back</a>
</div>
</div>
</form>
【问题讨论】:
-
报告是否在 rdlc 文件中定义了固定的宽度/高度?