none
SizeToReportContent vs Toolbar and ZoomMode RRS feed

  • Question

  • I'm using .Net Framework 4.5.2 with Report Viewer version 12. I need the reportveiwer to resize on both IE11 and Chrome; along with other browsers, but IE and Chrome are the main 2. To do this I need to set SizeToReportContent="true".  However, upon doing so, if the user changes the Zoom Mode to something like 150%, the report overwrites the reportviewer toolbar, and the user no longer has access to the toolbar.  If I don't do anything with the SizeToReportContent, then IE11 works fine; but Chrome does not resize the Report Viewer and you can't see the report.  Any ideas how to keep the toolbar above the report?

    This is simplified from what I'm doing...

    ASPX =

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestReport.aspx.cs" Inherits="Experiment2.TestReport" %>
    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" AsyncRendering="false" SizeToReportContent="true" ShowPrintButton="false" />
        </div>
        </form>
    </body>
    </html>

    C# =

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Configuration;
    using Microsoft.Reporting.WebForms;

    namespace Experiment2
    {
        public partial class TestReport : System.Web.UI.Page
        {
            private List<ReportParameter> paramList;

            private void SetParam(string Name, string values)
            {
                if (paramList == null) { paramList = new List<ReportParameter>(); }
                paramList.Add(new ReportParameter(Name, values));
            }

            protected void Page_Load(object sender, EventArgs e)
            {
                ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                ReportViewer1.ServerReport.ReportServerUrl =
                   new System.Uri(ConfigurationManager.AppSettings["ReportServerURL"]);
                ReportViewer1.ServerReport.ReportPath = ConfigurationManager.AppSettings["ReportDirectory"] + "ControlChart";

                SetParam("pUserKey", "1");

                SetParam("pFormulaKey", "25");
                SetParam("ProdYr", "2015");
                SetParam("SieveKey", null);
                SetParam("LotNumMin", null);
                SetParam("LotNumMax", null);

                ReportViewer1.ServerReport.SetParameters(paramList);
                ReportViewer1.ServerReport.Refresh();
            }
        }
    }

    Monday, March 21, 2016 4:34 PM