Tutorial: Creating a Quick Chart Report Offline (Report Builder 2.0)

You can do this quick little tutorial even if you're not connected to a report server or a database. The tutorial uses XML data that you can copy from this topic and paste right into the wizard so you can get started using Report Builder 2.0 right away.

In this tutorial, you'll create a pie chart by using a wizard, and then you'll modify it a little, just to get an idea of what's possible.

"My First Pie Chart" in Run view

Prerequisites

The only prerequisite is that you have Report Builder 2.0 installed on your computer. Ask your system administrator if you need installation instructions.

To create the pie chart

  1. Click Start, point to Programs, point to Microsoft SQL Server 2008 Report Builder, and then click Report Builder 2.0.

  2. On the design surface, click the Chart Wizard icon.

  3. In the Choose a connection to a data source page, click New.

    The Data Source Properties dialog box opens.

  4. You can name a data source anything you want. In the Name box, type MyPieChart.

  5. In the Select connection type box, click XML.

  6. Click the Credentials tab, select Use current Windows user. Kerberos delegation may be required, and then click OK.

  7. In the Choose a connection to a data source page, click MyPieChart and then click Next.

  8. Copy the following text and paste it in the large box in the center of the Design a query page.

    <Query>
    <ElementPath>Root /S  {@Sales (Integer)} /C {@FullName} </ElementPath>
    <XmlData>
    <Root>
    <S Sales="500">
      <C FullName="Michael Blythe" />
    </S>
    <S Sales="250">
      <C FullName="Linda C Mitchell" />
    </S>
    <S Sales="350">
      <C FullName="Jillian  Carson" />
    </S>
    <S Sales="450">
      <C FullName="Ranjit Varkey" />
    </S>
    <S Sales="150">
      <C FullName="Jae Pak" />
    </S>
    </Root>
    </XmlData>
    </Query>
    
  9. Click Next.

  10. In the Choose a chart type page, click Pie, and then click Next.

  11. In the Arrange chart fields page, double-click the Sales field in the Available fields box.

    Note that it automatically moves to the Values box, because it's a numerical value.

  12. Drag the FullName field from the Available fields box to the Categories box (or double-click it; it will go to the Categories box).

  13. Click Finish.

    You're now looking at your new pie chart report on the design surface. What you see is representational. The legend reads Full Name 1, Full Name 2, etc., rather than the salespeople's names, and the size of the slices of pie are not accurate. It's just to give you an idea of what your report will look like.

  14. To see your actual pie chart, click Run on the Home tab of the Ribbon.

After You Run the Wizard

Now that you have your pie chart report, you can play with it. On the Run tab of the Ribbon, click Design, so you can continue modifying it.

Make the chart bigger

First you probably want the pie chart to be bigger. Click the chart, but not on any element in the chart, to select it and drag the lower-right corner to resize it.

Add a report title

Click in the box that reads "Click here to add title" and type a title. How about My First Pie Chart?

Add percentages

To display percentage values as labels on a pie chart

  1. Right-click on the pie chart and select Show Data Labels. The data labels should appear within each slice on the pie chart.

  2. Right-click on the labels and select Series Label Properties. The Series Label Properties dialog box appears.

  3. Type #PERCENT{P0} for the Label data option.

    The {P0} gives you the percentage without decimal places. If you type just #PERCENT, your numbers will have two decimal places. #PERCENT is a keyword that performs a calculation or function for you; there are many others.

For more information about customizing chart labels and legends, see How to: Display Percentage Values on a Pie Chart (Report Builder 2.0) and How to: Change the Text of a Legend Item (Report Builder 2.0).

Add 3D Effects

The chart is rather flat. How about we give it a little depth?

To make a 3D chart

  1. Right-click the chart and select 3D Effects.

    The Chart Area Properties dialog box opens on the 3D Options page.

  2. Click Enable 3D.

    You can then rotate the chart and set its angle of inclination. The defaults are 30 and 30. Let's try those.

  3. Click Run to preview the report.

For more information, see How to: Add 3D Effects to a Chart (Report Builder 2.0).

What's Next?

Now that you've created your first report in Report Builder 2.0, you're ready to try the other tutorials and to start creating reports from your own data. To run Report Builder 2.0, you'll need permission to access your data sources, such as databases, with a connection string, which actually connects you to the data source. Your system administrator will have this information and can set you up.

To work through the tutorials, you'll need access to the AdventureWorks2008 sample database. Your system administrator can set that up for you, too.

Finally, to save your reports to a report server or a SharePoint site that is integrated with a report server, you'll need the URL and permissions. You can run any report you create directly from your computer, but reports have more functionality when run from the report server or SharePoint site. You'll need permissions to run your reports or others from the report server or SharePoint site where they are published. Again, talk to your system administrator to get access.

It might help to read about some of the concepts and terms before you get started. For more information, see Reporting Concepts (Report Builder 2.0). Also, spend some time planning, before you create your first report. It will be time well spent. For more information, see Planning a Report (Report Builder 2.0).