Using Crystal Reports and ASP.NET to Create Drill through Reports and Graphs
page 1 of 7
Published: 08 Jun 2010
In this article, Vince examines the creation of an ASP.NET web application that uses the CrystalReportPartsViewer Control to create a drill through report where the user can view summary level data and click on a hyperlink to drill into the details.
by Vince Varallo
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 39744/ 63


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

View Entire Article

User Comments

Title: When must a company buy a license from SAP ?   
Name: Hans
Date: 2011-01-26 6:26:28 PM

If a company wants to make a commercial web-site where the CrystalReportViewer in the web-site shows reports to the customers, must the company then buy a licence and if yes what kind of license? (Please give a link).

Let us for example assume that the commercial website is made like the example in this article ("Using Crystal Reports and ASP.NET to Create Drill through Reports and Graphs"). That is an ASP.NET (C#) application that shows results to the customers with CrystalReportViewer and the ASP.NET application runs on the company's server. The company's customers pay to access and see the results on the web-site (That is how the company earn money!).
Title: Version of Crystal Reports   
Name: Vince
Date: 2011-01-24 9:14:18 AM
The sample was written in Visual Studio 2008 using Crystal Reports for .NET. This is the free version of Crystal Reports that comes with Visual Studio.
Title: Version of Crystal Report   
Name: N Pradeep kumar
Date: 2011-01-24 7:02:44 AM
Please tell me the crystal reports version that supports drill down.
Title: An errror can occour in Visual Studioe 2010   
Name: Hans
Date: 2010-12-18 4:31:37 PM
When I tryed to make the example in this article in Visual Studio 2010 i got an error when running the application (not when compiling):

Parser Error Message: The base class includes the field 'CrystalReportPartsViewer1', but its type (CrystalDecisions.Web.CrystalReportPartsViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportPartsViewer).

I solved the error by replacing the autogenerated line in Default.aspx (when adding a CrystalReportPartsViewer):

<%@ Register assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>

With this line:

<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>

So the version number that Visual Studio 2010 inserts when adding a CrystalReportPartsViewer is wrong. In my case it should be: 13.0.2000.0

I hope this can help others...

It is a good article. Thanks.
Title: hello..........Sir   
Name: Kaushal Bhasker
Date: 2010-11-17 6:21:52 AM
This is very good........
i m agree whith this. all the way much
Title: Problem in chart   
Name: kamlesh makvana
Date: 2010-09-14 3:58:12 AM
how can i enable the don't summrized check box in chart using crystal report
Title: crystal report navigation   
Name: tanya
Date: 2010-06-22 3:33:55 AM
i am using a crystal report for dynamic information
while i am running it only first page shows the data but i have thousands of records to be placed in crystal reports.
how can i place my record in second page of crystal report
Title: Crystal report export to excel, page header issue using visual studio 2008 sp1   
Name: MFiaz
Date: 2010-06-17 7:23:08 AM
I have a Crystal report it has dynmic information on page header when I export to excel,

only first page header shows in excel. I am using visual studio 2008 sp1.

if I export it to others format like pdf, word etc... its working fine

lets assume

page header contanis

department name = 'Operations'
date = 16-06-2010

employee name code
xyz 1
eee 2
cxy 3

here cxy is related to department 'accounts'

if we see this data in pdf or word

it will show correctly

department name = 'Operations'
date = 16-06-2010

employee name code
xyz 1
eee 2

department name = 'Accounts'
date = 16-06-2010

employee name code
cxy 3

can you send me a sample?

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-12 11:34:35 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search