Have you ever gone to a web site that allows you to view a
pie chart and then are able to click on the data and drill into the details
that make up the total? Well, Crystal Reports has a control called the
CrystalReportPartsViewer that allows you to easily create this functionality in
your own sites. This article will create a web page to display the sales data
from the AdventureWorks sample database by Country, then by State, and then by
City. I'll first show you how to display the data as a table and allow the user
to click on the data to drill into the details. I'll then change the report so
the data is displayed as a pie chart and incorporate the same drilling functionality.
This article uses the AdventureWorks sample database that
can be downloaded from http://msftdbprodsamples.codeplex.com/releases/view/37109
for SQL Server 2008. Download and install the AdventureWorks2008_SR4.exe file.
The sample code is written using Visual Studio 2008 but it will work with
Visual Studio 2005 as well. If you do not have SQL Server 2008 you can use SQL
Server 2005 but you'll need to download the 2005 AdventureWorks samples.
The goal of this article is to create web pages that look
like the following images.
Your user can click on a section of the pie chart to drill
into the details of each section. This makes for a slick interface and a
professional looking application.
You can download the sample code for this application here.