Pro SQL Server 2012 Reporting Services

(sharon) #1
CHAPTER 13  CREATING REPORTS USING REPORT BUILDER 1.0, 2.0, AND 3.0

Creating a Data Source View

You create data source views for a report model project from relational data sources, where you have a
list of tables that can be joined to form the basis of the data source view. In the Pro_SSRS_2008R2
database, you know many related tables are joined by column ID fields; for example, the Admissions table
joins to the Patient table via the PatID field. Fields in both tables may be relevant to a user designing a
report; however, superfluous data may just confuse that user. Part of your job as the report modeler is to
remove the complexity of the schema but also provide a model that contains intuitive or “friendly”
names and provides only the data that will be useful. Why should you use Dscr for a diagnosis code, when
you really should just make it Diagnosis Name, for example? Since it is also possible to add objects to a
data source view that are derived tables made from custom queries, you will have more control over
creating a custom data source view and eliminate much of the work of removing the extraneous fields
included in all the tables you are using. This will become more evident to you as you step through the
process. For now, we will show how to perform the following logical steps to keep the data source view
and subsequent model simple but effective:



  • Building a query instead of many multiple tables for the data source view

  • Selecting only relevant and potentially useful fields for the report designers, based
    on their requests

  • Using friendly names for data source view fields and values


The first step in creating the view, like with the data source, is to open the wizard by right-clicking
the Data Source Views folder and selecting Add New Data Source. Clicking Next to proceed to the next
screen in the wizard will bring you to a screen depicted in Figure 13-6.


Figure 13-6. Adding a data source view to the project


On the first page of the wizard (not the welcome page, on which you should immediately check
Don’t Show This Page Again), select the Pro_SSRS_2008R2 data source you created earlier, and then click
Next to move to the Select Tables and Views page. As you can see in Figure 13-7, you can choose from
many tables.

Free download pdf