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

robust, but the presentation of the basics is pretty typical). Notice, however, that the name we selected<br />

for the report became the default header for the report.<br />

If you go ahead and click the preview tab for the report, you’ll find that it is largely the same as the<br />

report we generated using the Report Model notion. There are, however, some formatting areas where<br />

the defaults of the report modeler are perhaps a tad better than we have here — in particular, it makes<br />

no sense for us to report the time as part of the date if the time is always going to be midnight. With that<br />

in mind, let’s make some alterations to the Wizard-generated report.<br />

Try It Out Altering Report Projects<br />

We have a really great start to our report generated in seconds by the wizard. It is not, however, perfect.<br />

We want to format our dates more appropriately.<br />

1. Right-click the first date field (Order Date) and select Text Box Properties to bring up the dialog<br />

shown in Figure 17-28.<br />

2. Click on the fx to indicate that we want to change the output to be that of a function result,<br />

bringing up our function dialog, as shown in Figure 17-29.<br />

3. Add in the use of the FormatDateTime function. Note that I’ve expanded the function helper<br />

down below. You can double-click functions and it will insert the base function name into the<br />

window above. Also, it will provide context-sensitive tooltips similar to other parts of Visual<br />

Studio as you are filling in the function. Also note that this particular function does have an<br />

optional parameter that would allow us to specify a particular date representation style (say,<br />

European or Japanese), but we’re going to allow the function to format it based on whatever<br />

the localized settings are on the server.<br />

Figure 17-28<br />

539

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

Saved successfully!

Ooh no, something went wrong!