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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

One could spend an entire chapter just going over the nuances of each entity of the model and all the<br />

attributes within it. Take particular note of how <strong>SQL</strong> <strong>Server</strong> automatically breaks down well understood<br />

attributes (such as dates) to smaller attributes (say, month, day, and year) based on well understood<br />

common uses of the underlying data type.<br />

As it happens, we probably do want this field hidden, but you often see instances where something like<br />

the Sales Order ID, although system generated, would be the order number a customer would see on an<br />

invoice. Many identity values are artificial, “under the covers” constructs, and thus why <strong>SQL</strong> <strong>Server</strong><br />

assumes you wouldn’t want to show this in the report.<br />

Deploying Our Model<br />

Well, building a Report Model is all well and good, but if no one can get at it, it serves little purpose<br />

(much like designing a stored procedure, but never actually adding it to your database). To make our<br />

report usable to end users, we must deploy it.<br />

Fortunately deploying our model couldn’t get much easier. Indeed, the hard part is knowing that you<br />

need to and then finding the command to do so. To deploy, simply right-click in a white space area of<br />

the Solution Explorer (or on our actual report), or right-click the project name and choose Deploy. You<br />

can watch the progress of the deploy in the output window of Visual Studio:<br />

Build complete -- 0 errors, 0 warnings<br />

------ Build started: Project: ReportModelProject, Configuration: Production ------<br />

Build complete -- 0 errors, 0 warnings<br />

------ Deploy started: Project: ReportModelProject, Configuration: Production<br />

------<br />

Deploying to http://localhost/Report<strong>Server</strong><br />

Deploying data source ‘http://localhost/Report<strong>Server</strong>/Data Sources/Adventure<br />

Works<strong>2008</strong>’.<br />

Deploying model ‘AdventureWorks<strong>2008</strong> Report Model.smdl’.<br />

Deploy complete -- 0 errors, 0 warnings<br />

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========<br />

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========<br />

Report Creation<br />

Our Report Model is, of course, not itself a report. Instead, it merely facilitates reports (and, considering<br />

there are lots of business type people who understand reports, but not databases, facilitating reports can<br />

be a powerful thing). Now that it is deployed, we can generate many reports from just the one model.<br />

To see and generate reports, you need to leave the Business Intelligence Studio and actually visit the<br />

reporting user interface — which is basically just a Website. Navigate to http:///reports — in my case, I have it right on my local system, so I can get there by navigating<br />

to http://localhost/reports, as shown in Figure 17-20.<br />

531

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

Saved successfully!

Ooh no, something went wrong!