Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ReportViewer 9 control in VS 2010

I am writing an ASP.NET app that uses a SQL Server 2005 with SSRS setup. I want to use the ReportViewer control but I get an error when using ReportViewer 10 because it needs SSRS 2008.

How can I use ReportViewer 9 within my application. I've added a reference to the Microsoft.ReportViewer.WebForms.dll version 9 and removed the reference to version 10.

My markup is as follows:

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!-- standard markup -->
<rsweb:ReportViewer ID="ReportViewer1" runat="server"></rsweb:ReportViewer>

but when I try to run this I get the following error:

CS0433: The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll'

What have I missed!?

Update: When trying to use the ReportViewer 10 I get the following error:

"Remote report processing requires Microsoft SQL Server 2008 Reporting Services or later."

like image 401
Fermin Avatar asked Jun 10 '10 09:06

Fermin


People also ask

How do I create a Rdlc report in Visual Studio 2010?

To create a dataset for the RDLC report, click Reporting under Visual C# Items. Click Report, and then click Add. The Report Wizard opens. Enter a dataset name in Name field.To choose a data source for the dataset, click New on the right of Data source drop-down combo box.

How do I add Microsoft ReportViewer to Winforms?

To add the ReportViewer Control to a Windows application If the Toolbox is not visible, you can access it from the View menu by selecting Toolbox. Drag the ReportViewer control onto the design surface of the Windows Form.


1 Answers

Figured it out, forgot to change 3 references in the web.config file:

within HttpHandler:

<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

and within assemblies:

<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
like image 156
Fermin Avatar answered Nov 07 '22 02:11

Fermin