Masriyah
Masriyah

Reputation: 2505

ReportViewer not displaying report properly in Firefox and Chrome

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>

Upvotes: 3

Views: 12307

Answers (5)

Afzal
Afzal

Reputation: 117

Add ZoomMode="PageWidth" and SizeToReportContent="True" attributes to ReportViewer control in Viewer.aspx page.

Like:

<rsweb:ReportViewer ID="ReportViewer" 
   runat="server" Width="100%" Height="100%" 
   ZoomMode="PageWidth" SizeToReportContent="True">
</rsweb:ReportViewer>

Upvotes: 0

Prakash Patel
Prakash Patel

Reputation: 11

There is another fix for it, simply remove the Doctype from the page in which you have used the reportviewer.

If there is textbox rendering problem then set CanGrow=false

It is working for all the browsers in my case.

Upvotes: 1

friggle
friggle

Reputation: 3471

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.

Upvotes: 8

Masriyah
Masriyah

Reputation: 2505

Oddly enough i found the reason for the glitch. Since this was only happening to some reports i compared reports and noticed the reports which i had a line break caused the glitch and for the report not to show in FF or chrome (only showing the header of the report). So taking out the line break fixed my problem. I also replaced the line break with a bunch of under scores in a text box.

Upvotes: 0

CoffeeCode
CoffeeCode

Reputation: 4314

The deal is that Microsoft ReportViewer officialy does not support Chrome.
This link should help http://msdn.microsoft.com/en-us/library/ms251673.aspx
But it works perfectly in IE! :)

Say thanks to MS ;)

Upvotes: 2

Related Questions