0
votes

I'm doing a project in ASP.NET C# framework 4.0 with VS2012. I need to create a ReportViewer. I created the report .rdlc, but when I try to show it in a view, it appears blank(the toolbar of the report viewer control appears and shows 1/1 page). I tested it in IE9, IE10, Mozilla and Chrome, and the result is the same.

Here is the code of the view:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FitxaBolo.aspx.cs" Inherits="Activa_la_Cultura.Views.FitxaBolo" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>

    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
    <div>
        <rsweb:ReportViewer AsyncRendering="False"  id="ReportViewer1" runat="server" Height="1200px" Width="1200px"></rsweb:ReportViewer>
    </div>
    </form>
</body>
</html>

And here is the code behind:

    if (!Page.IsPostBack)
    {

        var compañia = (string)HttpContext.Current.Session["compañia"];
        var actividad = (string)HttpContext.Current.Session["actividad"];
        var municipio = (string)HttpContext.Current.Session["municipio"];
        var fecha = (string)HttpContext.Current.Session["fecha"];
        var lugar = (string)HttpContext.Current.Session["lugar"];
        var horario = (string)HttpContext.Current.Session["horario"];
        var llegada = (string)HttpContext.Current.Session["llegada"];
        var contacto = (string)HttpContext.Current.Session["contacto"];
        var observaciones = (string)HttpContext.Current.Session["observaciones"];

        var table = new DataSet1().Bolo;

        table.AddBoloRow(compañia, actividad, municipio, fecha, lugar, horario, llegada, contacto, observaciones);

        DataTable tb = (DataTable) table;
        var rds = new ReportDataSource(table.TableName,tb);
        ReportViewer1.LocalReport.DataSources.Clear();
        ReportViewer1.ProcessingMode = ProcessingMode.Local;
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/FBolo_Report.rdlc");
        ReportViewer1.LocalReport.DataSources.Add(rds);          
        ReportViewer1.LocalReport.Refresh();

    }

I check that all the variables have the value, and the path of the report is correct. Ah, I'm filling the report thorugh a DataSet called Dataset1, and this one has a table named Bolo that have the fields compañia, fecha, etc...

I add to web.config all the lines related with the reportviewer control, concretly the version 11.

Thanks in advance.

1

1 Answers

0
votes

Try this:

  1. Edit "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js" (on the SSRS Server)
  2. Append the following script:

    function pageLoad() {    
    var element = document.getElementById("ctl31_ctl09");
    if (element) 
    {
        element.style.overflow = "visible"; 
    } }
    

Attention please: div's name is not always ctl31_ctl09: in my case it is (with a previous service pack it was ctl31_ctl10, instead).

If this solution doesn't work, look at the HTML from your browser to see if the script has worked properly changing the overflow:auto property to overflow:visible; you have to change div name in the sctipt, maybe.