Create a Data Set


By:
Overview

A Data Set contains a query that Reporting Services uses to retrieve the data for our report. This query could be a SQL statement like we used in the Design the Query step of the Report Wizard section; it could also be a stored procedure that we execute. In this section we will define a new Dataset by using the same query that we used earlier in the Report Wizard section.

Explanation


To create a Dataset right click on the AdventureWorksLT Shared Data Source that we created in the previous section and select Add Dataset from the menu as shown below:

dd dataset

The Dataset Properties dialog will be displayed as shown below:

ataset properties

The first thing to do is to provide a name; enter Main in the Name textbox. Since we only have one Shared Data Source in our project, it will be selected automatically in the Data source dropdown. To define our query we could click the Query Designer button and do it graphically or we could type in the query as we did in the Report Wizard section. Instead click the Import button which will initially display the familiar Open File dialog; navigate to the report that we created earlier in the Report Wizard section of the tutorial as shown below:

mport query file open

Click OK to display the Import Query dialog as shown below:

mport query dialog

The above dialog displays the Datasets and their queries from the report. Our earlier report has only one Dataset so just click the Import button. If the report had multiple Datasets, you could choose the Dataset from the list on the left.

The Report Data area now shows our new Dataset and the list of available fields as shown below:

eport data with dataset

We are now ready to continue on to the next section to configure a Table for our report layout.


Last Update: 1/5/2010




Comments For This Article

















get free sql tips
agree to terms