ReportViewer not displaying report properly in Firefox and Chrome

Masriyah picture Masriyah · Dec 21, 2012 · Viewed 11.1k times · Source

I am trying to run this report page which is being displayed on a page and it appears to work/display fine in IE but when i run it in Firefox or Chrome I only get the header bar of the report and either i have to refresh the report or page and then it will work - also tried clicking on the next and previous page arrows on the report header to display the report on the page properly. I am not sure what is the cause or if could be fixed but it something frustrating at times.

This is what i have for the page running/displaying the report:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ActivityReport.aspx.cs" Inherits="Kids.MVC.Reporting.ActivityReport" %>
<form id="form" runat="server">
    <asp:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="false" />
    <uc1:ReportViewer ID="reportViewer" runat="server" />
</form>

This is my ReportViewer display page I have:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.ascx.cs"
Inherits="Kids.MVC.Reporting.ReportViewer" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<style type="text/css">
    .ReportViewer table
    {
        border-collapse: collapse;
        border-spacing: 0;
    }
    .ReportViewer *  
    {
        background-image:none;       
    }
</style>
<div class="ReportViewer">
    <rsweb:ReportViewer ID="reportViewer" runat="server" Width="100%" Height="100%" AsyncRendering="False"
        ExportContentDisposition="AlwaysAttachment" SizeToReportContent="true" BackColor="White" ShowRefreshButton="False">
    </rsweb:ReportViewer>
</div>

Answer

friggle picture friggle · Oct 3, 2013

There is a very simple fix for this. Put the ReportViewer control in a div, and set the div's height to a large number (1000px is a good, round choice).

Setting SizeToReportContent="true" can also fix this.

Either solution makes it work for me, but the OP already has it set to true, so it might not work in all cases.