Solved

How to use the ReportDataSource in a report viewer control

Posted on 2014-09-17
1
503 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 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