Reputation: 3969
I'm having a lot of "fun" trying to get my report to fill the browser's screen.
The report viewer fits to the screen but the underlying report does not follow.
Here's what I've tried:
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();
}
And the markup:
<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>
Upvotes: 1
Views: 15701
Reputation: 104
You can try this code .
ReportViewer1.ZoomMode = Microsoft.Reporting.WebForms.ZoomMode.PageWidth;
I think it will help you..
Upvotes: 2
Reputation: 345
You need to add SizeToReportContent = true in the rsweb:reportviewer tag.
For example:
<rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="false" ProcessingMode="Remote" SizeToReportContent="true">
Upvotes: 2
Reputation: 1091
ReportViewer full screen is only supported in Interet Explorer and even then it is a bit flakey. If you really want it try this:
http://forums.asp.net/t/1771258.aspx
Upvotes: 0