Solved

How to change data source for an existing report?

Posted on 2011-03-22
2
1,482 Views
Last Modified: 2012-08-14
Hi,

I have copied reports from one SSRS server to another server. Now, the reports need to use a different shared data source. The shared data source is already created, but know of the reports are using it. How can I change the data source for the reports within MS Visual Studio 2008?

Thanks
0
Comment
Question by:gtrapp
  • 2
2 Comments
 
LVL 18

Assisted Solution

by:Raheman M. Abdul
Raheman M. Abdul earned 500 total points
ID: 35193336
First we need to change the security settings for connecting to the data source. In the report page, click on Properties > Data Sources. Change the “Connect using” to “Credentials stored securely in the report server” and specify an account that has access to the data. Also check “Use as Windows credentials…”.

Source:
http://alexduggleby.com/2008/07/18/sql-server-reporting-services-2008-tutorial-in-5-minutes-or-how-to-send-my-boss-a-report-from-a-view-quickly/
0
 
LVL 18

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
ID: 35193380
Updating Data Source References in a Report Definition

The report definition includes dataset elements that define the data source structure used by the report. The dataset elements are added to the report definition during report design. A new element is added each time you drag a specific field to a data region or text box in the report.

Updating the report definition is necessary if you are copying report definition files between projects that have different data sources or if you modified the datasets used in your project. If you subsequently modify the actual dataset in the project by removing or renaming fields or tables, the report definition will no longer contain valid references. To update the report definition, use the Data Sources dialog box as described in the following steps.
How to Update References in a Report Definition

   1.

      Open the client report definition (.rdlc) file in graphical design mode.
   2.

      From the Report menu, select Data Sources. The Report Data Sources dialog box appears. You can use the following options:
          *

            To add a new dataset to the report definition, select a Project data source and click Add to report. In most cases, this option is not necessary. Project data sources are added to the report definition automatically when you drag fields to the report layout.
          *

            To remove an existing dataset reference from the report definition, select the dataset and click Remove.
          *

            If you renamed a dataset in your project, you can use the Report Data Sources dialog box to update the dataset name in the report definition. Click the Rename button to set the dataset name in overwrite mode, and then type the new name.
   3.

      Click Refresh All to update the report definition file with your changes.

Rebinding Data Sources to the ReportViewer Control

The ReportViewer control requires data bindings to access application data sources at run time. Data bindings are created for the control when you select a client report definition (.rdlc) file.

Rebinding a data source is necessary if you modify a report definition that has already been bound to a control, if you modify the dataset after the control has been bound to a form or Web page, or if you add a new dataset to the report. All of these scenarios result in bindings that are out-of-date. Use the Rebind Data Sources task on the ReportViewer Tasks smart tags panel to update the data bindings in application code.
NoteNote

Not all modifications to a report definition require that you rebind a data source. Rearranging items, formatting items, or reusing the same data-bound field in multiple data regions are examples of modifications that do not invalidate existing data bindings. Similarly, if you modify a part of the data source that is not used in the report, you do not need to update the bindings.
How to Rebind Data Sources

   1.

      Open the form or Web page that contains the ReportViewer control.
   2.

      In the ReportViewer Tasks smart tags panel, click Rebind Data Sources. You can inspect the code behind the form or page to confirm the changes.

Choosing Data Sources for the ReportViewer Control

When you convert a server report definition (.rdl) file to a client report definition (.rdlc), you must ensure that your application includes data binding code for the ReportViewer control. The data binding code is generated automatically when you create a .rdlc file from a report template. However, the data binding code will be missing if you create the .rdlc file in some other way. To add the data binding code, use the Choose Data Sources task on the ReportViewer Tasks smart tags panel. To learn more about converting report definitions, see Converting RDL and RDLC Files.
How to Add Data Source Bindings

   1.

      Open the form or Web page that contains the ReportViewer control.
   2.

      In the ReportViewer Tasks smart tags panel, click Choose Data Sources. You can inspect the code behind the form or page to confirm the changes.

For more details refer : http://msdn.microsoft.com/en-us/library/ms252085%28v=vs.90%29.aspx
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

13 Experts available now in Live!

Get 1:1 Help Now