17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 17: Reporting for Duty, Sir! A Look At Reporting Services<br />

If you ponder Figure 17-7 for a moment, you’ll notice that there is a bit more to our Report Model project<br />

than just data sources; indeed, we now need to take the next step and create a Data Source view.<br />

Data Source Views<br />

A Data Source view has a slight similarity to the views we learned about in Chapter 10. In particular, it<br />

can be used to provide users access to data, but can filter what data they actually see. If we give them<br />

access to the entire data source, then they are able to see all data available to that data source. Data Source<br />

views allow us to filter the data source down to just a subset of its original list of available objects.<br />

To add our Data Source view, simply right-click Data Source View and select Add New Data Source<br />

View (tricky, isn’t it?), as shown in Figure 17-8.<br />

Figure 17-8<br />

We get another of those silly “Welcome to the Wizard” dialogs, so just click Next and you’ll arrive at a<br />

dialog that you’ve essentially already seen before — one that is basically identical (only one or two very<br />

subtle cosmetic differences) to one we had partway through creating our data source — Figure 17-5.<br />

Accept the default, and then click through to the Select Tables and Views dialog shown in Figure 17-9.<br />

This one, as the name suggests, allows us to specify which tables and views are going to be available to<br />

end users of the Report Model we’re building.<br />

Start by selecting SalesOrderDetail and then use the > button to move that into the Selected Objects<br />

column. Next, click the Add Related Tables button and see what happens. <strong>SQL</strong> <strong>Server</strong> will use the rules that<br />

it knows about the relationships between the tables (based on defined foreign keys) to figure out what tables<br />

are related to the one or more tables we had already selected. In this case, it chose SalesOrderHeader<br />

(the parent of our SalesOrderDetail table) and SpecialOfferProduct (to which SalesOrderDetail<br />

also has a foreign key). For the report we’ll be building, we don’t need the SpecialOfferProduct table,<br />

so remove that by selecting that table and using the < button. Finally, add the Customer, Person and<br />

Product tables to finish catching up with the tables I have selected in Figure 17-9.<br />

Don’t worry about the Filter or “Show system objects” options in this table; both are pretty harmless.<br />

The short rendition is that the filter just filters down the object list to make it easy to deal with databases<br />

that have a very large number of objects to show. The “Show system objects” option is just that —<br />

it allows you to include system objects in the Report Model (which seems pretty silly to me for the vast,<br />

vast majority of applications out there).<br />

523

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!