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 />

Play around with the report some, and you’ll find that you can easily re-sort the result in other ways.<br />

Note that we also could have defined a default sort order — for example, sorting those with the soonest<br />

due date — by setting it in the Sort and Group dialog (next to Filter in the toolbar).<br />

A Few Last Words on Report Models<br />

Report Models are certainly not the catch-all, end-all of reporting. It is, however, a very cool feature in<br />

the sense that you can expose data to your end users in a somewhat controlled fashion (they don’t see<br />

any more than you put in the data source, and access to the data source is secured such that you can control<br />

which users see which data sources), but still allow them to create specific reports of their own.<br />

Report models offer a very nice option for “quick and dirty” reports.<br />

Finally, keep in mind that we generated only one very simple report for just the most simplistic of layouts.<br />

Report Models also allow for basic graphing and matrix reporting as well.<br />

Report Ser ver Projects<br />

536<br />

Report Models can be considered to be “scratching the surface” of things — Reporting Services has much<br />

more flexibility than that. (Indeed, I’m sure there are entire books around just on Reporting Services; there<br />

is that much to it.) In addition to what we’ve already seen, the Business Intelligence Development Studio<br />

will allow you to create Report <strong>Server</strong> Projects.<br />

As I mentioned before, there are entire books around just this subject, so the approach we’re going to<br />

take here is to give you something of a little taste of the possibilities through another simple example.<br />

(Indeed, we’re just going to do the same example using the project method.)<br />

At this point, you should be fairly comfortable with several of the concepts we’re going to use here, so<br />

I’ll spare you the copious screenshots such as those you’ve already endured, and get to the nitty-gritty of<br />

what needs to be done to get us up to the point of new stuff:<br />

1. Open a new project using the Report <strong>Server</strong> Project template in the Business Intelligence Development<br />

Studio (note that this is different from the Report Model project we used earlier).<br />

2. Create a new data source against our AdventureWorks<strong>2008</strong> database. (Right-click the Shared<br />

Data Source folder and fill in the dialog — use the Edit button if you want the helpful dialog to<br />

build your connection string, or you can just copy the connection string from earlier in the chapter).<br />

Note that, to deploy this new data source, you’re going to need to name it something other<br />

than the name you used earlier in the chapter (assuming you did that example).<br />

3. Right-click the Reports folder and choose Add New Report. This takes you to the Report Wizard —<br />

click Next to move on to the Data Source Selection screen. Select the data source you just created.<br />

Then click Next.<br />

This should bring you to the query dialog shown in Figure 17-25.<br />

I have, of course, added the query in myself; this one should roughly duplicate the report we built in the<br />

Report Model section including the filter to just unshipped orders. I could have also entered the query<br />

builder and, while in the builder, even executed the query to verify that my query returned the expected<br />

data. Note that we also could have executed a stored procedure at this point or gone directly against a<br />

specific table.

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

Saved successfully!

Ooh no, something went wrong!