Solved

How to use the ReportDataSource in a report viewer control

Posted on 2014-09-17
1
463 Views
Last Modified: 2014-09-18
Hi I am using a reportviewer control in visual studio 2012 and I want to reset the datasource of the report viewer, but I can't figure out the right name value combination:
The Datasource in my .rdlc is "RF" and the Dataset in the .rdlc is "dsTotalOrderCalls"
I have an Objectdatasource ID:  "odsSales" and a type name:  "RapidFire.RFTableAdapters.USP_TOTAL_ORDERCALLSTableAdapter"
that is referring to a table adeapter in an .xsd (dataset) that is calling a stored procedure called "USP_TOTAL_ORDERCALLS"  and returning a data table called:  "USP_TOTAL_ORDERCALLSDataTable"

When I try to open a new instance of the reportdatasource ie,
rv_SalesSC.LocalReport.DataSources.Add(new ReportDataSource("dsTotalOrdersCalls", odsSalesSC));

I receive an error message saying:
Cannot create a connection to data source 'RF'

Can someone help me understand what values go into instantiating a new reportdatasource object?
Thank you!!!
0
Comment
Question by:Scarlett72
1 Comment
 

Accepted Solution

by:
Scarlett72 earned 0 total points
ID: 40330624
my stored proc was producing an error based on the parameters I was sending it, I was able to instantiate the object using: rv_SalesSC.LocalReport.DataSources.Add(new ReportDataSource("dsTotalOrdersCalls", odsSalesSC)); which is the name of my .rdlc dataset and the ObjectDataSource ID value
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now