Click here to Skip to main content
Click here to Skip to main content

Switching Data Sets When Working With Microsoft Reporting Services With SQL

, 14 Sep 2007
Rate this:
Please Sign up or sign in to vote.
Switching Data Sets when working with Microsoft Reporting Services
Screenshot - DataSourcePic.jpg

Introduction

This article describes how to switch data sources (datasets) when working with a report using Microsoft Reporting Services with SQL Server Business Intelligence Development Studio. This is important when your report may utilize different data sources, for example, one for test and one for production. This solution is based on using the SQL Server Business Intelligence Development Studio to easily make the changes to the data source as opposed to manually editing the report definition language XML source code, which opens up the chance for errors if you don't know what to edit.

Background

This article assumes a working knowledge of using Microsoft Reporting Services with SQL Server Business Intelligence Development Studio.

Using the GUI

You'll first need two shared data sources already set up under "Shared Data Sources" in Solution Explorer. Here I have two listed:

Screenshot - DataSourcePic.jpg

Next, go into an existing report and click on the data tab as shown below. You'll notice I am using a Test data set named "EduLendingTest":

Screenshot - DataTab.jpg

Next, click on the ellipsis button Screenshot - EllipsisButton.jpgnext to the DataSet dropdown menu. The tooltip "Edit Selected DataSet" will appear as shown:

Screenshot - EditDataSetButton.jpg

The DataSet window pop-up will appear. In this window, select the "Data Source" dropdown menu, and select the data source you wish to switch to. In this instance, I am switching to "EduLendingProd (shared)" as shown:

Screenshot - SelectProdDataSet.jpg

Next, change the name of the data set. In this example, I used the same name as the data source I created highlighted here, then clicked OK:

Screenshot - ChangeDataSetNameToProd.jpg

Next, click on the Layout tab:

Screenshot - LayoutTab.jpg

Click on the report table, then right-click the report table and select "Properties":

Screenshot - SelectReportProperties.jpg

In the Table Properties window, select the new data set name from the "Dataset name:" dropdown list as shown here and then click OK:

Screenshot - TablePropertiesWindow.jpg

Save your report and you should be able to use your new data set with the underlying data source.

Points of Interest

This approach was much easier than trying to edit the underlying XML rdl code, which got me in trouble. Hopefully this important, but not well known function will be made easier to use in future releases and will be better documented.

History

Submitted 09/11/2007

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

harryteck
Web Developer
United States United States
Harry is a .NET Developer for a major financial institution building web and stand alone applications and class libraries. He also has experience teaching courses on ASP.NET and Microsoft databases. He holds a graduate degree in Information Science.

Comments and Discussions

 
GeneralREgenerating Field List Pinmembershumakercs8-Apr-11 11:38 
GeneralUsing report parameters to build report's connection string would be easier... [modified] PinmemberNino Mrdjen20-May-08 2:24 
GeneralRe: Using report parameters to build report's connection string would be easier... Pinmembercaradens17-Oct-08 14:22 
GeneralRe: Using report parameters to build report's connection string would be easier... PinmemberPonyRydr13-May-11 2:44 
A little late to the party, but THANK YOU! Been searching for some time now on how to do this. This makes perfect sense now, but I didn't think of it because there was no option in the connection string textbox. Wink | ;)
 
Also available here: http://msdn.microsoft.com/en-us/library/ms156450.aspx
GeneralI can't disagree more! PinmemberKABay20-Sep-07 10:57 
GeneralRe: I can't disagree more! [modified] Pinmemberharryteck24-Sep-07 4:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140821.2 | Last Updated 14 Sep 2007
Article Copyright 2007 by harryteck
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid