Report Builder 3 Creating a Basic Report

26
Report Builder 3.0 Creating a Basic Report 24 August 2012 By Robert Sheldon Report Builder is underrated as a BI and report-authoring tool. It is a free stand-alone application from Microsoft that provides an intuitive way for anybody to create reports from data. It uses an interface that is similar to Microsoft Office, and supports the full capabilities of SQL Server 2012 Reporting Services. Rob Sheldon starts a short course in how to use it. Report Builder 3.0 is a report-authoring tool that’s part of the Reporting Services suite of tools available in SQL Server 2008 R2. However, Report Builder is a free, stand-alone application that can be used by SQL Server developers and business users alike to create reports rich in data visualizations. It provides an Office-like interface that makes it easy to connect to a variety of data sources—such as SQL Server, SQL Azure, Oracle, and SAP NetWeaver BI—and to display the data from those sources in tables, charts, lists, gauges, and maps. In this article, you’ll learn how to use Report Builder to create a report that displays data from a SQL Server database. Keep in mind that this article is only the first in a series of articles about Report Builder. This one covers only what you need to know to build a basic report. As we progress through the series, you’ll learn how to use other Report Builder elements that let you create a variety of interesting and informative reports. You can download Report Builder at the Microsoft Download Center. There you’ll find details about system requirements and additional information about the installation process. You can also download sample reports that you can open in Report Builder. To try out the examples in this article, you’ll need Report Builder 3.0 installed on your system. You’ll also need access to a SQL Server instance with the AdventureWorks sample database installed. The database will provide the data you need to create your report based on the examples I demonstrate here. On my system, I used a local instance of SQL Server 2012 with the AdventureWorks2012 database installed. But you can use different versions of both SQL Server (2005 and on) and the AdventureWorks database. The best way to learn Report Builder is to jump right in. In this article, I walk you through the steps necessary to connect to a data source, define a dataset, and present the data in a formatted table. The goal of the article is to provide you with the foundation you need so you can create other types of reports as you need them. Of course, I can’t show you everything in a single article, but I can give you the information you need to start working with Report Builder right away. Getting Started with Report Builder All it takes to use Report Builder is to have it installed on your system. Of course, to create a report, you’ll also need to have access to a data source, such as a SQL Server database. But everything else is available through the Report Builder interface, so to get started, your initial step is to launch the application. When you first open Report Builder, the GettingStarted dialog box appears, as shown in Figure 1. (You can see the Report Builder interface behind it.) The dialog box provides several options for creating a new report or opening an existing one. For the purposes of this article and the ones to follow, we won’t be using this dialog box. If you like, you can select the Don’t show this dialog box at startup option so you don’t have to mess with it going forward. Or you can simply close the box by clicking the red Close button in top-right corner.

Transcript of Report Builder 3 Creating a Basic Report

Page 1: Report Builder 3 Creating a Basic Report

Report Builder 3.0 Creating a Basic Report 24 August 2012 By Robert Sheldon

Report Builder is underrated as a BI and report-authoring tool. It is a free stand-alone application from Microsoft that provides an intuitive way for anybody to create reports from data. It uses an interface that is similar to Microsoft Office, and supports the full capabilities of SQL Server 2012 Reporting Services. Rob Sheldon starts a short course in how to use it. Report Builder 3.0 is a report-authoring tool that’s part of the Reporting Services suite of tools available in SQL Server 2008 R2. However, Report Builder is a free, stand-alone application that can be used by SQL Server developers and business users alike to create reports rich in data visualizations. It provides an Office-like interface that makes it easy to connect to a variety of data sources—such as SQL Server, SQL Azure, Oracle, and SAP NetWeaver BI—and to display the data from those sources in tables, charts, lists, gauges, and maps. In this article, you’ll learn how to use Report Builder to create a report that displays data from a SQL Server database. Keep in mind that this article is only the first in a series of articles about Report Builder. This one covers only what you need to know to build a basic report. As we progress through the series, you’ll learn how to use other Report Builder elements that let you create a variety of interesting and informative reports. You can download Report Builder at the Microsoft Download Center. There you’ll find details about system requirements and additional information about the installation process. You can also download sample reports that you can open in Report Builder. To try out the examples in this article, you’ll need Report Builder 3.0 installed on your system. You’ll also need access to a SQL Server instance with the AdventureWorks sample database installed. The database will provide the data you need to create your report based on the examples I demonstrate here. On my system, I used a local instance of SQL Server 2012 with the AdventureWorks2012 database installed. But you can use different versions of both SQL Server (2005 and on) and the AdventureWorks database. The best way to learn Report Builder is to jump right in. In this article, I walk you through the steps necessary to connect to a data source, define a dataset, and present the data in a formatted table. The goal of the article is to provide you with the foundation you need so you can create other types of reports as you need them. Of course, I can’t show you everything in a single article, but I can give you the information you need to start working with Report Builder right away.

Getting Started with Report Builder All it takes to use Report Builder is to have it installed on your system. Of course, to create a report, you’ll also need to have access to a data source, such as a SQL Server database. But everything else is available through the Report Builder interface, so to get started, your initial step is to launch the application. When you first open Report Builder, the GettingStarted dialog box appears, as shown in Figure 1. (You can see the Report Builder interface behind it.) The dialog box provides several options for creating a new report or opening an existing one. For the purposes of this article and the ones to follow, we won’t be using this dialog box. If you like, you can select the Don’t show this dialog box at startup option so you don’t have to mess with it going forward. Or you can simply close the box by clicking the red Close button in top-right corner.

Page 2: Report Builder 3 Creating a Basic Report

Figure 1: The welcome screen that appears when you open Report Builder

After you close the GettingStarted dialog box, you’re presented with the Home tab of the Report Builder interface, which is shown in Figure 2. At the top of the interface is the type of ribbon you’ve become familiar with in Microsoft Office products. It contains the options necessary to create and design your report. For each tab of the interface, the ribbon contains a different set of options. (You’ll learn more about these options as we progress through this article and the ones to follow)

Figure 2: The Home tab of the Report Builder interface

Page 3: Report Builder 3 Creating a Basic Report

At the left edge of the Report Builder interface is the ReportData window, which provides a hierarchical view of the built-in fields, parameters, images, data sources, and data sets available to your report. As with the ribbon options, we’ll dig into these more as we progress through this series. Same thing for the RowGroups and ColumnGroups windows, which, as you might expect, are tied to the way you group data on your report. The main part of the Report Builder interface is the layout window (outlined in red). This is where you construct your report. Here you can add and configure the elements necessary to display your data, such as tables, graphs, and charts. You can also add elements such as text, images, and lines—many of the things that make your reports more appealing and effective. Report Builder also includes a set of options that apply to the application as a whole. To access these options, click the Report Builder button (the large round button at the top-left corner of the screen), and then click the Options button. This launches the ReportBuilderOptions dialog box, shown in Figure 3.

Figure 3: The Report Builder Options dialog box

The dialog box opens to the Settings page, which lists a number of options related to the Report Builder interface and report deployment. For now, the only setting that might concern you is the option Use this report server or SharePoint site by default. When you installed Report Builder, you might have specified a Reporting Services (SSRS) report server where you would eventually deploy your reports. If you provided an incorrect URL or that URL has changed, this is the place to enter the correct information. If the information is incorrect, you will have to wait for Report Server to verify the connection every time you start the application, which can be somewhat time-consuming. So if this issue applies to you, enter the path and then click OK. Note: If you’re connecting to a Reporting Services instance other than the default, you append the instance name onto the path, preceded by an underscore. For example, the report server on my system was installed as part of SQL Server instance ws02/SqlSrv2012. As a result, I appended _sqlsrv2012 onto the URL http://ws02/reportserver so it became http://ws02/reportserver_sqlsrv2012, as you can see in Figure 3.

You might have noticed that the ReportBuilderOptions dialog box also includes a Resources page, which provides access to details about Report Builder and to additional information available online.

Page 4: Report Builder 3 Creating a Basic Report

One other feature you should be aware of before we get started is how to save a report. When you first open Report Builder, you are essentially starting a new report. You can save this report and then access it as you work on it. To do so, click the ReportBuilder button and then click Save. This launches the SaveAsReport dialog box, shown in Figure 4.

Figure 4: Saving a report in Report Builder

Although the SaveAsReport dialog box shows several option for saving a report, you essentially have two choice: save to the file system or save to the report server you designated in the ReportBuilderOptions dialog box. For now, we’ll simply save our report file to the local file system. On my system I navigated to the C:\DataFiles folder and named the report Annual Sales, which becomes the file name. Notice that Report Builder reports use the .rdl extension, just like Reporting Services reports. Reporting Services reports and Report Builder reports are created using the Report Definition Language (RDL), an XML-based language that defines how data is retrieved and a report is laid out. Once you’ve named and saved your report file, you’re ready to start creating your report. Be sure to save the file regularly as you develop your report. That way, you can always come back to the report and start where you left off. So, with that in mind, let’s get started.

Adding a Data Source to Your Report Before you can add data to a report, you must be able to connect to a data source. The data source provides the connection necessary for your report to retrieve the data used to populate its contents. To add a data source, right-click the Data Sources node in the ReportData window, and then click AddDataSource. This launches the DataSourceProperties dialog box, shown in Figure 5.

Page 5: Report Builder 3 Creating a Basic Report

Figure 5: Adding a data source to your report

As you can see in the figure, you provide a name for your data source and then choose whether to use a shared connection or a connection embedded in the report. The first option lets you browse to a shared data source that has been published to a report server. Since we have not set up any shared data sources, we’ll go with the second option, which means we need to configure the connection we want to embed in the report. So provide a name for your data source—I used AdventureWorks on my system—and then select the option Use a connection embedded in my report. When you select this option, new options appear in the DataSourceProperties dialog box, as shown in Figure 6. Notice that you must now select a connection type and define a connection string.

Figure 6: Configuring your data source

Page 6: Report Builder 3 Creating a Basic Report

A Report Builder data source supports numerous connection types. To see a full list of what’s available, click the down arrow on the Selectconnectiontype drop-down list. You can then select the connection type you want to use. For this article, we’ll be using the MicrosoftSQLServer connection type, which is the default value, so in this case, you don’t need to take any steps to specify the connection type. Next, you must build your connection string. The connection string shown in Figure 6 (in the Connectionstring text box) is the one I built for our examples. To build the connection string, click the Build button. This launches the ConnectionProperties dialog box, shown in Figure 7.

Figure 7: Building a connection string for your data source

From the Servername drop-down list, select the SQL Server instance that contains your source data. Then, if necessary, select an authentication model for connecting to that SQL Server instance. If you plan to use Windows Authentication, you don’t need to do anything. However, if you’ll be using SQL Server Authentication, you must select the Use SQL Server Authentication option and provide the necessary credentials. (To keep things simple for these exercises, I used Windows Authentication and ran Report Builder as an administrator) Next you must select the database that contains the source data. Since I’m using the AdentureWorks2012 database, that’s the one I selected. Figure 8 shows you what the ConnectionProperties dialog box looked like on my system after I finished configuring the connection properties.

Page 7: Report Builder 3 Creating a Basic Report

Figure 8: Configuring the connection properties

After you’ve configured the properties, you should test your connection. Then click OK to close the dialog box. You’ll be returned to the DataSourceProperties dialog box, which should now look similar to the one shown in Figure 6. You might have also noticed that the DataSourceProperties dialog box includes a Credentials page. (So far, we’ve been working on the General page.) As shown in Figure 9, the Credentials page lets you change the credentials used to connect to the data source.

You can configure this page only if your data source connection is embedded in the report (otherwise the options are grayed out). The report server can then use these credentials to connect to that data source. This enables other users to run the report without having to provide credentials for the underlying data source connection.

Page 8: Report Builder 3 Creating a Basic Report

Figure 9: Changing the credentials used to connect to a data source

For now, we don’t need to be concerned about setting these credentials. So return to the General page if necessary and again test your connection. Then click OK to close the DataSourceProperties dialog box. Your new data source is added to the DataSources node in the ReportData window.

Adding a Dataset to Your Report The next step in building your report is to create a dataset. A dataset defines the actual data that you want to retrieve from your data source. For example, if you’re data source is a SQL Server database, the dataset will be based a query or stored procedure that returns a result set you can use to populate your reports. The dataset acts as a bridge between your report and the data source. The data source establishes the connection, and the dataset defines what data is retrieved through that connection. To create a dataset, right-click the Datasets node in the ReportData window, and then click AddDataset. This launches the DatasetProperties dialog box, shown in Figure 10. The dialog box opens on the Query page, which is the only page we need to be concerned about for now.

Page 9: Report Builder 3 Creating a Basic Report

Figure 10: Adding a dataset to your report

As with the data source, you can use either a shared dataset or embed one in your report. Again, we’ll embed the information in the report. So provide a name for the dataset—I used AnnualSales—and then select the option Use a dataset embedded in my report. When you click this option, you’re presented with a several additional options, as shown in Figure 11.

Figure 11: Configuring a dataset for your report

Page 10: Report Builder 3 Creating a Basic Report

First, you’ll need to select the data source on which the dataset is based. From the Datasource dropped-down list, select the AdventureWorks data source (or whatever you named your data source). Then, in the Query text box, enter the following query: SELECT

BusinessEntityID,

FirstName,

LastName,

JobTitle,

City,

StateProvinceName,

CountryRegionName,

TerritoryName,

TerritoryGroup,

SalesQuota,

SalesYTD,

SalesLastYear

FROM

Sales.vSalesPerson

WHERE

TerritoryGroup IS NOT NULL;

As you can see, we’re selecting several columns from the Sales.vSalesPerson view. Each column returned from the query can be used as a field in your report. Click OK to close the DatasetProperties dialog box. Your dataset should now be listed on the Datasets node in the ReportData window. And beneath the dataset, you should see a list of the fields returned by your dataset. For example, you should see the BusinessEntityID, FirstName, LastName, JobTitle, and all the other columns returned by your result set. You can now use these fields to build your report.

Adding a Table to Your Report Once you’ve added your data source and dataset, you can add a data region or data visualization. A data region is a report object that displays your source data in a tabular format (rows and columns). Report Builder supports the following data region objects: Table: A tabular object that contains a fixed number of columns. But the rows are dynamic, which means they can

expand to accommodate the data you’re trying to display. It also means you don’t need to know how many rows of data will be returned by the data source when you add your table to the report, although you do have to specify the columns.

Matrix: A tabular object similar to a table, except that your columns can be static or dynamic, which means the report can grow both vertically and horizontally. A matrix is a lot like a crosstab or pivot table.

List: A tabular object that presents data in a freeform fashion. Lists are handy for creating forms such as invoices. As we work through this series, we’ll dig deeper into each of these data region types. But for now, let’s look at the data visualizations. A data visualization is an object that displays the source data graphically in order to provide a conceptual overview of the underlying information. Report Builder supports the following data visualizations: Chart: A graphical presentation of the data in the form of such objects as bar, pie, and line charts. Gauge: A key performance indicator (KPI) that presents a range of data, with an indicator that points to a specific

value within that range. Map: Data presented against a geographical background. The data can be based on SQL Server spatial data, an

Economic and Social Research Institute (ESRI) shapefile, or Microsoft Bing map tiles.

Page 11: Report Builder 3 Creating a Basic Report

Data bar: A simple chart used in conjunction with other data and charts to present complex information in a small space. A data bar typically represents only a single data point.

Sparkline: A simple chart similar to a data bar, except that it typically presents a series of information. Indicator: A small gauge that displays the state of a single data value.

As with the various types of data regions, we’ll go into each of the data visualizations more deeply as we progress through this series. For now, let’s focus on how to add a table to our report. To do so, go to the Insert tab, shown in Figure 12. As you’ll discover, the ribbon includes the data regions and data visualizations—along with other elements—that you can add to your report.

Figure 12: The Insert tab of the Report Builder interface

If you want, you can modify your design surface to make it bigger. You can also reduce the size of the RowGroups and ColumnGroups windows. For example, as you can see in Figure 13, I made the design surface bigger and moved the text box within the footer. (The footer is the region beneath the dotted line near the bottom of the design surface.)

Page 12: Report Builder 3 Creating a Basic Report

Figure 13: Modifying the design surface in Report Builder

The best way to learn how to move these elements around is to experiment with them. Normally it involves dragging a corner or side from one point to the other. If you’ve ever worked with a draw program, you’ll find the principles to be essentially the same. Now let’s add out table. Click the down arrow beneath the Table icon on the ribbon, and then click InsertTable. Next, move your cursor to the design surface. The cursor becomes a plus sign with a tiny table icon. Position the cursor where you want the top-left corner of your table to sit, click the left mouse button, and then drag the cursor to the point where you want the bottom-right corner to sit. The red arrow in Figure 14 shows the direction to move the cursor.

Figure 14: Adding a table to your report

When you let go your cursor, the table object is added to your report. It should look similar to the one shown in Figure 14 (without the red arrow, of course). The next step is to add the fields you want to include in your report. For the

Page 13: Report Builder 3 Creating a Basic Report

report I’m demonstrating here, we’ll add the following fields (in the specified order): FirstName, LastName, TerritoryGroup, SalesQuota, and SalesYTD. To add a field, drag it from the list of fields in the ReportData window to the appropriate column in the table object. For example, drag the FirstName field to the first column and the LastName field to the second column. For the fourth column, drag the field to the right side of the table.

When a heavy blue line appears, drop the field on that line. The column will be added to the table. You might have to play around with this a bit, but over all you should find the process very straightforward. Once you’ve added all five columns, your table should look similar to the one shown in Figure 15.

Figure 15: Adding columns to your table

That’s all there is to adding a table to a report. You can now view the report so you can see how the table will look after the report has been deployed report. To view the report, click the View button at the left end of the ribbon. This will take you to the Run tab, as shown in Figure 16.

Page 14: Report Builder 3 Creating a Basic Report

Figure 16: Viewing the table you’ve added to your report

As you can see, the table is now populated with the columns and rows of data from your data source, with the column headings displayed in the first row. Notice that Report Builder automatically changes compound column names to separate words. By previewing the report in this way, you know how it will be rendered once it is actually deployed. The data might change, but the format itself will remain.

Moving Ahead with Report Builder Of course, the way the table is currently displayed in the report is fairly inadequate. Although you now know how to add a data source, dataset, and table, that’s not enough to make a report something that people will want to look at. You must attend to the elements that control how the table and the rest of the report look so you’re presenting data in a readable and accessible way. In the next article, I’ll show you how to format your report to address these issue. Be sure to save the report you created here, because we’ll be building on that as we learn more about the various ways you can make your report a lot more appealing. There is a lot that can be done to make basic tabular reports more readable, using Microsoft's free Report Builder. Rob Sheldon continues his exploration of the power of this tool by showing how to format various elements within reports.

In the preceded section, I introduced you to Report Builder and showed you how to create a report that included a table. The table displayed sales data retrieved from the AdventureWorks2012 database via a data source and dataset you added to your report. However, the table in the final report was very basic and not particularly readable. Fortunately, Report Builder includes many features that let you format the various elements within your reports. In this article, the second in the series, you’ll learn some of the ways you can format your report elements so your reports are more readable and users can easily access the information they need. If you want to try out the examples on your own system, you’ll need to first create the basic report that we created in the first article.

For those of you new to Report Builder, you should review that article to learn how to add a table to the report. If you’re already familiar with how to build a basic report, you can use the following list of specifications to set up your report environment:

Page 15: Report Builder 3 Creating a Basic Report

A data source that connects to the AdventureWorks2012 database on a local instance of SQL Server 2012. Another version of SQL Server or the database should be okay.

A dataset that uses the data source to retrieve data from the Sales.vSalesPerson view. The dataset is configured with the following query to retrieve the data:

SELECT

BusinessEntityID,

FirstName,

LastName,

JobTitle,

City,

StateProvinceName,

CountryRegionName,

TerritoryName,

TerritoryGroup,

SalesQuota,

SalesYTD,

SalesLastYear

FROM

Sales.vSalesPerson

WHERE

TerritoryGroup IS NOT NULL;

A Table data region that contains data from the following fields in the dataset (in the specified order):

FirstName LastName TerritoryGroup SalesQuota SalesYTD

After you’ve added these elements, your report should look similar to the one shown in Figure 1. Notice that the ReportData window shows the AdventureWorks data source, the AnnualSales dataset, and the dataset’s fields. Also notice that the design surface contains the actual table, with the specified fields inserted.

Figure 1: Creating a basic report that contains a table

Page 16: Report Builder 3 Creating a Basic Report

That’s all you need to get started with formatting your report. So let’s dig into some of the Report Builder features you can take advantage of in order to enhance your report’s looks and usability.

Formatting Your Table The first step we’re going to take is to add a border around each cell so that the entire table is enclosed in borders. The easiest way to do this is to add the borders all at once, which means you must select all the cells. One way you can do it is to select the top-left cell (First Name), hold down the Shift key, and then click the bottom-right cell ([SalesYTD]). All the cells should now be enclosed in a single rectangle with a thick gray border, as shown in Figure 2.

Figure 2: Selecting the table cells that should have borders

Next, in the Border section of the Home ribbon, click the BorderSide down arrow, and then click All, as shown in Figure 3. (Note that, if the All border is already selected for the BorderSide option, you need only click the icon.)

Figure 3: Selecting the border type for your selected table cells

When you click the border option, borders are added around each cell, as shown in Figure 4. You can verify this by clicking the Run button to view what the table looks like with borders.

Page 17: Report Builder 3 Creating a Basic Report

Figure 4: The table cells enclosed in borders

As you might recall from the first article, when you click the Run button, you can preview what the report will look like when it’s been rendered on a user’s computer. In fact, you should regularly use the Run button to check what your table and report are looking like as you format the various report elements. That way, if you add an element that doesn’t work, you can undo it right there, rather than having to unravel dependencies later in your report development process. Now let’s look at how we can configure the table’s header row to make it stand out from the rest of the report. Because we’ll format each cell in the header the same way, we can select the entire row of cells to make our changes. Once the row is selected, click the Center button in the Paragraph section on the Home ribbon. Then, in the Font section, click the Bold button. Your header row should now look similar to the one shown in Figure 5.

Figure 5: Configuring the table’s header row

Next we’ll add color to the header row. With the cells still selected, click the Shading down arrow in the Border section. You’ll be presented with a collection of colors from which to choose, as shown in Figure 6.

Page 18: Report Builder 3 Creating a Basic Report

Figure 6: Adding color to the table’s header row

For this exercise, I selected LightGreen; however, you can select any color you want. You can even click the Morecolors link to choose from numerous other shades. Once you’ve selected a color, the table’s selected rows receive that color, as shown in Figure 7.

Figure 7: The table’s header row after it’s been formatted

Next, we’re going to modify how the numerical values in the Sales Quota and Sales YTD columns are displayed. Select the second row of the last two columns (cells [SalesQuota] and [SalesYTD]). In the Number section of the Home ribbon, click the CurrencySymbol button to display the values in those cells as currency. The next step is to center the text horizontally. Select all the cells in the table as you did when creating borders. Then, in the Paragraph section, click the Middle button so your text sits in the middle of your cells. Finally, resize the two rows to the height you prefer for displaying your table’s rows of data. For this report, I preferred rows with a smaller height, but you can set the height to whatever you think is best for your table. Also set your column widths to the desired size. To change the row heights or column widths, you must use the selectors displayed to the left of the rows and above the columns. Notice in Figure 7 the gray blocks next to and above the table. These are your selectors. Use them to adjust the cell sizes. (You might have to play around with the selectors a bit to get a feel for how to use them to adjust your cells.)

Page 19: Report Builder 3 Creating a Basic Report

Figure 8 shows what my table looked like after I adjusted my rows and columns. Your table might look slightly different from this.

Figure 8: Resizing the rows in the table

That’s all there is to configuring your table. You can, of course, make other changes, such as modifying the font or changing the border sizes and colors. Your best bet for learning how to format a table is to try out the various options and then see how they look when you view the report. The more you play with them, the more you’ll learn.

Formatting Your Report Without a doubt, the table is the centerpiece of our report, and it’s important to make it look right. However, you can—and should—format other report elements as well. So let’s look at some of the ways you can do that. The first step we’ll take is to add a title to our report, which in this case is “Annual Sales.” To add the title, click the area at the top of the design surface that reads Click to add title, and then type Annual Sales. Next, in the Paragraph section of the Home ribbon, click the Center button to center the text.

Then reposition the title’s text box as necessary so it’s centered above the report, as shown in Figure 9.

Figure 9: Adding a title to your report

You can then change the font used for the title. One way to do that is to adjust the settings in the Font section of the home ribbon. Or, if you want to have more direct control over your font, click the tiny arrow in the bottom-right corner of the Font section.

Page 20: Report Builder 3 Creating a Basic Report

This launches the TextBoxProperties dialog box. You can take this approach only if the text box itself is selected, rather than the text. You can tell if the text box is selected by the small squares at the corners and midsections (refer back to Figure 9). When the TextBoxProperties dialog box appears, go to the Font page if you’re not already there. From the Font page, you can configure the font, as shown in Figure 10.

Figure 10: Selecting a font for your report’s title

In this case, I’ve selected CopperplateGothicBold for the Font option, but left all the other options with their default values. However, you can configure the text with whatever font settings you think best suit your report. Once you’ve configured the font, click OK to close the TextBoxProperties dialog box. If necessary, reposition or resize the text box to adjust for the new font settings. Your title should now look similar to the one shown in Figure 11.

Figure 11: The reformatted title at the top of the report

At this point, you can resize your design surface and reposition report elements as necessary. To move a report element, such as a table or text box, make sure the element is selected and then use the cross-arrows to move the box around.

Page 21: Report Builder 3 Creating a Basic Report

For example, Figure 12 shows the footer’s text box. Notice that I’ve moved it to the right so it lines up to the end of the table.

Figure 12: Resizing your report and repositioning report objects

In addition to moving the footer text box, I also resized the design surface and the footer area. In addition, I moved the table up toward the title. Again, the best way to learn how to move report items around is to play with them, repositioning and resizing as necessary. And whenever you make a change, view the report to see how your changes work. Experimentation is your best friends in this case. Another feature of Report Builder is the ability to add such graphic elements as lines and rectangles and figures. For instance, I decided to add a line to the footer, just above the footer’s text box. To add a line, go to the Insert tab. In the ReportItems section, click the Line icon. Then move your cursor to the spot where you want to start the line, click and hold down your left mouse button, and drag your cursor to the point you want to end the line. For instance, if you refer to Figure 13, you’ll see that I added a line above the footer text box.

Figure 13: Formatting the report’s footer

You might have noticed that I changed the color of the line from black to dark blue. To make this change, you have to access the line’s property. First, make sure that the line is selected. (Small boxes hang off of either end.) Go to the View tab and select the Properties check box.

This opens the Properties window, which you can see in Figure 13. In the Style section, change the setting in the LineColor property from Black to DarkBlue or whatever color option you want to select. You can then close the Properties window. Next, I modified the text in the footer. I again selected the text box and opened the Text Box Properties dialog box. I then changed the Style setting to Italic and the Color setting to Dark Blue.

Page 22: Report Builder 3 Creating a Basic Report

Up till now, I’ve said nothing about the footer text itself, which you’ve no doubt noticed reads &ExecutionTime. This is actually a placeholder that points to the ExecutionTime built-in field. Report Builder supports a number of built-in fields that you can use to provide values dynamically to your report. In this case, the ExecutionTime field provides that date and time that you run your report. You can display additional or different information in the footer by adding a text box or modifying the text in the default text box. For this example, we’ll modify the existing text. To do so, double-click the &ExecutionTime placeholder to open the PlaceholderProperties dialog box, shown in Figure 14.

Figure 14: Accessing the properties of the footer’s text

Notice that &ExecutionTime is displayed in the Value text box. You can either modify the default value directly within the text box, or you can click the expression builder button to the right of the text box to open the Expression dialog box, shown in Figure 15. (The expression builder button is the one whose label looks like fx.) For our example, we’ll use the Expression dialog box to modify the text value.

Page 23: Report Builder 3 Creating a Basic Report

Figure 15: Modifying the footer’s text

When you first open the Expression dialog box, it shows an expression in the Set expression for: Value text box. That expression, =Globals!ExecutionTime, is the actual underlying expression that the &ExecutionTime placeholder points to. All Report Builder expressions begin with an equal sign followed by the body of the expression, which is this case is Globals!ExecutionTime.

The Globals part of the expression is used because the ExecutionTime field is part of the Global scope and is available to any component in your report. The exclamation point is used to separate the scope from the actual field name. If you refer back to Figure 15, you’ll see that I’ve modified the default expression by adding the string value Date & Time: (enclosed in double quotes, with an ending space). I’ve also included the concatenation operator (&) to concatenate my string value with the ExecutionTime built-in field. You can, of course, do far more with your expression. I’ll be covering Report Builder expressions in more detail later in this series. But for not, this is the only change you need to make to your expression. So click OK to close the Expression dialog box.

When you’re returned to the Placeholder Properties dialog box, you’ll see that the value in the Value text box has been changed to <<Expr>> to indicate that an expression has been defined. Now click OK to close the Placeholder Properties dialog box.

When you’re returned to the design surface, you’ll see that the footer text now reads <<Expr>>, as shown in Figure 16.

Page 24: Report Builder 3 Creating a Basic Report

Figure 16: The report’s updated footer

There are many other ways in which you can modify your report elements, but what we’ve done so far should give you a sense of the possibilities. So let’s look at one more way to enhance your report.

Adding an Indicator to Your Report Report Builder includes a number of visualizations that let you display information that makes it easy to understand and compare data. For example, we can add an indicator to our table that provides a quick overview of the data. An indicator is a small gauge that displays the state of a single data value. It acts as a key performance indicator that lets you quickly assess a value in one of your columns. To add an indicator, right-click the Sales YTD column, point to Insert Column, and then click Right. A new column is added to the table. Resize the design surface and column to accommodate a small icon for the indicator.

Next, right-click the data (bottom) portion of the new column, point to Insert, and then click Indicator. When the Select Indicator Type dialog box appears, select the three flags, and then click OK. A flag indicator is added to the new column, as shown in Figure 17.

Figure 17: Adding an indicator to your report

After you add the indicator, right-click it in the indicator, and then click Indicator Properties. When the Indicator properties dialog box appears, go to the ValuesandStates page, as shown in Figure 18. On this page, you configure how you want your indicator to read based on the values of the identified column.

Page 25: Report Builder 3 Creating a Basic Report

Figure 18: Configuring your indicator’s properties

For our example, we’ll base our indicator on the SalesYTD column. In the Value drop-down list, select [Sum(SalesYTD)]. Our indicator will now be based on the total amount of sales listed in that column. By default, the indicator bases which color is displayed on percentages. Any individual SalesYTD value that falls within the bottom third of the total values receives a red indicator. A value that falls in the middle third receives a yellow indicator. And a value that falls in the top third receives a green indicator. For the purposes of our exercise, the default values works fine, so click OK to close the Indicator properties dialog box. The last step you might want to do is to add a text box to your report that explains the flag indicator colors. For example, Figure 19 shows a text box I added at the bottom of the table. Notice that it provides a brief explanation of the flag colors.

Figure 19: Adding a text box to the bottom of your report

To add a text box, resize your design surface and footer as necessary. Then go to the Insert ribbon and, in the ReportItems section, click Text Box. Position your cursor on the design surface where you want to start your text box, click and hold the left mouse button, and then drag the cursor to the position you want to end your text box. Then add the necessary text and background color. This is also a good time to do any final resizing and repositioning of your report items to make sure they display the information the way you want it displayed. When you have everything where you want it, click the View button to review your report. It should now look similar to the one shown in Figure 20.

Page 26: Report Builder 3 Creating a Basic Report

Figure 20: Viewing your formatted report

As you can see, all the elements we’ve added and formatted are now displayed. Notice that the report includes a title and an additional column for the flag indicator. And the flags themselves are colored according to the value in the SalesYTD column. The report also includes a text box at the bottom of the table that contains information about the flags. In addition, the footer displays the Date & Time: label along with the actual timestamp.

Moving Ahead with Report Builder Not surprisingly, there are many more steps you can take to format and enhance your report. You can add graphics and use expressions more extensively. And, as the flag indicator shows, you can add visualizations that make it easier for viewers to understand the information being displayed. In the next article and the articles to follow, we’ll dig deeper into data visualizations so you can see the wide range of options you have for displaying data.

The key to any report is to make sure your report viewers can access the information they need as quickly and efficiently as possible. And visualizations can be an effective way of doing that. In the meantime, as was stressed earlier in this article, the best way to become comfortable with formatting your reports is to experiment with the various options. This article has given you a good place to start, but the rest is up to you.