The Where, What, and How of Every SQL Server Report
The elements of a report
We're going to jump in to creating reports in just a second, but I have got one key concept to cover first so that when we do jump in, things will make a lot more sense. See, every report you make in Reporting Services will require that you provide three elements, three things, three distinct kinds of information in order, that I'll describe as the where, the what, and the how. Where is the data for this report, what is the data for this report, and how should it be presented? And we need to describe each of these three pieces individually.
Without all three, you don't have a report. So first, where is it? Where is the data that you're interested in, and how do you connect to it? Literally what machine is it on? What's it called? Because Reporting Services is not restricted to only creating reports from data on the same physical SQL Server machine. Sure, that it is very common, but it can talk to other SQL Server machines, whether they are across the room or across the world. They can talk to other database systems. They can talk to SharePoint lists.
They can talk to XML files. So if we want to create a report and, say, base it on data in a SQL Server database, we begin by providing the name of the server, the actual name of that machine, then the name of the database on that server, because there's typically multiple different databases. And because just naming a database is not going to get you inside it--all databases are typically secured, so we will also need to provide some kind of authentication details so that database will actually let us in.
So this is your report's source of data, your data source, and that is the term that we use. We are defining the data source. So if that's the where, the next step is what? What is your data? Now, you might think you just provided this, but you didn't. Our data source is just us pointing to the database we are interested in, saying where it is and how we connect to it. But we don't want the entire contents of that database just dumped out on a report. So in the what step we specify the data that we want.
What is that data exactly? What tables, what rows, what columns, in what order, with what conditions? This is the subset of the data that we are interested in, and this is called the data set. And finally, once we've defined the where-- the data source--and the what--the data set--we can define the how. How should this be presented? What does it look like? What is the layout? So from purely presentational choices like what fonts and what colors we are using, to more structural choices, because the same data could be shown many different ways.
So is it just raw text and numbers, or will we generate charts and graphs from this data? Will we allow viewers to interact with the report and re-sort it and move through pages of it? So everything that we are going to do is going to fall into the where--the data source--the what--the data set--and the how--our report layout--and it's different kinds of thought process that we need for each step. So next, let's see an example.
Before diving into SQL Server report creation, watch this online video to learn a few key concepts to help you understand the elements of a report more clearly. Creating reports requires three basic items: where to find the data for the report, what data to include and how the report will be presented. You will also learn how to describe the elements of a report individually.
LINQ with C# Essential Training91,402 Views
Querying Microsoft SQL Server 2012369,318 Views
ASP.NET MVC 5 Essential Training528,627 Views
PowerShell Desired State Configuration Essential Training6,723 Views
CCNA ICND2 Essential Training95,372 Views
SQL Server 2008 Essential Training1,662,172 Views
SQL Essential Training2,256,215 Views
PHP with MySQL Essential Training4,283,533 Views
Foundations of Programming: Fundamentals7,772,051 Views