Solved

How to use the ReportDataSource in a report viewer control

Posted on 2014-09-17
1
497 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with preventing selection from a combobox 11 34
Function after success of Jquery/AJAX action 9 28
Code works but breaks when I add one section 4 20
Groupbox Control ? 2 19
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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