次の方法で共有


Visual Studio 2012 and 2013 crashes when you bind datasource to RDLC from Report Viewer web control

You’ve a visual studio 2012 or 2013 web application project that uses report viewer control with local mode reports (RDLC).

You’ve created the RDLC report and bound to a Data Set. You’ve also configured the Report viewer web server control to use the newly created report.

Under these circumstances, when you run the project from Visual studio, you get the following error message.

  • An error has occurred during report processing.
    • Cannot create a connection to data source 'AdventureWorksDataSetDept'.
      • The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource3' could not be found

To mitigate the issue you’ve to rebind the data source with your report from report viewer control.

To do that, from the Report Viewer properties (as shown below) you select Choose Data Sources option and then select the appropriate Data Source. Unfortunately when you do this, Visual studio will terminate unexpectedly.

image

To workaround the issue:

1. On the ASPX page that hosts the Report viewer web server control, locate the ObjectDataSource control and open the properties as shown below.

image

2. Select the Configure Data Source option.

3. You’ll see the Data Set just qualified with the Table Adapter name as shown below.

image

3. From the drop down, Select the Data Set that is fully qualified with your project name along with the Table Adapter name as shown below.

image

4. Click on Next and then Finish.

5. Save the project and now run the project. The report should execute successfully as expected.

HTH!

Selva.

[All the posts are AS-IS without any warranty]

Comments

  • Anonymous
    January 15, 2014
    Great job, thanks for the blog post!!

  • Anonymous
    January 16, 2014
    Nice post...

  • Anonymous
    September 22, 2014
    helpful post