Search code examples
c#asp.netiis-7reportwindows-server-2008

Reports are blank on win serv 2008 but not on win7


I have an asp.net C# application, when building or debuging the app (development enviroment) and if we deploy it to iis 7 on win 7, the reports will show.

However when deploying app on iis on win server 2008 reports will return blank.

Troubleshooting: Followed instructions provided by the links below - Confirmed

Made sure that reportviewer dlls are installed on machine (win serv 2008 currently working with version 10.0.0.0) - Confirmed

Other applications are already runnin on this server and work perfectly fine - Confirmed

To be honest I have no idea what the issue might be

Web.Config

<system.web>
<assemblies>
            <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

</assemblies>
 <httpHandlers>
            <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>
</system.web>
<system.webServer>
  <handlers>
    <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </handlers>

page.Aspx

    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    <div id="tabs">
      <ul>
       <li><a href="#tabs-1">Tab1</a></li>
      </ul>
    <div id="tabs-1">
      <rsweb:ReportViewer  ID="ReportViewer1"  runat="server"  width="100%" Height="100%" SizeToReportContent="true" AsyncRendering="false">
      </rsweb:ReportViewer>
    </div>

Code behind

 private void getReport(ReportViewer report_viewer, string report_path, ReportParameter report_parameter, DataTable sourceTable, DataTable sourceGraph)
    {
        report_viewer.ProcessingMode = ProcessingMode.Local;
        report_viewer.LocalReport.ReportPath = Server.MapPath(report_path);
        report_viewer.LocalReport.DataSources.Clear();
        report_viewer.LocalReport.SetParameters(new ReportParameter[] { p1 });
        report_viewer.LocalReport.DataSources.Add(new ReportDataSource("Table", sourceTable));
        report_viewer.LocalReport.DataSources.Add(new ReportDataSource("Graph", sourceGraph));
        report_viewer.LocalReport.Refresh();

    }

Reference 1

Reference 2


Solution

  • So no problem with the reports themselves, however as KSib mentioned there was an issue getting the data from the DB. One must be careful when working with dates, especially if the development machine has a different language than the deployment server.