Creating Professional Reports using Crystal Report for Visual Studio.NET (Part 1)
 
Published: 10 Feb 2004
Unedited - Community Contributed
Abstract
A step by step guide to developing Drill Down reports in Visual Studio.NET using Crystal Reports. A Drill Down report is interactive, intended to enhance the viewer's experience by initially providing only a summary of the overall information and then allowing the viewer to drill-down to the details of his interest.
by Eric Landes
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 77414/ 138

Introduction

Editor's Note: The first edition of this article was written by Ajay Varghese.

Our previous walkthrough, Crystal Report for Visual Studio.NET provided an introduction to the usage of Crystal Reports in a web application using Visual Studio.NET.  Moving further, this 3-part walkthrough series is intended to help you implement techniques that can add more power to your Crystal Report files.

The topics covered in this walkthrough include :

- Drill Down reports for interactive reporting

- Charts to display data graphically

- Groups to categorize data

- Conditional formatting to format & Hide/Display sections of a report

- Formulas to calculate/format data

A Drill Down report is interactive, intended to enhance the viewer's experience by initially providing only a summary of the overall information and then allowing the viewer to drill-down to the details of his interest.

In this walkthrough we will create a report using the PUBS database, which initially shows the Stores details.  The viewer can then drill down to view the Book Title details, which can further be drilled down to view the Order details.

Graphically speaking, what we would like to achieve in this walkthrough is the report shown when you click on the link below.

Add Crystal File report

  Click here to view the demo in Flash

In the first part of this series, we will use the Report Expert Wizard to generate the report for us. To do this follow these steps :

1. Add a Crystal Report file into your project.  This should pop up the Crystal Report Gallery window. On this pop up window, leave the ‘Using Report Expert’ option checked and select ‘Drill Down’ from the Choose an Expert section.

The various tabs on the Report Expert window allows you to set all the required options from specifying the data source to setting the chart properties that you need for the report.

Report: Data Tab

Data Tab

2. To set the data source, select OLE-DB (ADO) and specify the database settings to select the PUBS database.

 

3. Once you have the appropriate database displayed under the current connection, select the SALES, STORE & TITLE tables to be used in the report.

 

Group Tab

Group Tab

6. The Group tab allows you to create the required groups to categorize the data. Note that it is based on these groups that you get additional sections on the report which can be manipulated to work as the drill-down sections. The order in which you select the fields to be grouped by also matters.  Create two groups by specifying Store Name first and then the Title Id.

 

Total Tab

Total Tab

7.  The Total tab allows you to specify the field to summarize on, for each of the groups. There are numerous Summay Types to choose from. For the sake of simplicity, we will stick to the default which is Sum

Drill Tab

Drill Tab

8. The Drill tab is where you can specify if you want to hide any of the sections. To make only the Store details visible initially you would want to hide the rest of the sections.  Just click on second section (titles.title) and you will notice that the section on which you clicked and the ones below it are now hidden.

Chart Tab

Chart Tab

The Chart tab allows you to specify the chart details that should appear on the report.  A chart inserted into the drill down report will be plotted using the dynamic data from the data source and provides clickable areas which can be used to drill down.  All this is taken care in the background by the Crystal Report Engine.  Notice that this tab contains additional tabs (Type, Data and Text)

 

Type Tab

9.  The Type tab allows you to specify the type of chart to be included into the report.  Select Pie Chart.

 

          Data Tab

10.  The Data tab allows you to specify the data that would be used to generate the chart.  As we would like this chart to appear only once in the Report to reflect the Stores data, stick to the default selections as shown in the screen snap shot.

Finishing the Report

11.  You could skip the other tabs for the time being and click finish

You should see the Crystal Report Designer containing all the field names placed into the Page Header, and Field values being placed into the Detail section.  Each Group Header and Footer contains the name of the Group.  You would also notice that the Group 2 Header, Detail Section and Group 2 Footer sections are shaded. The shading implies that these sections are initially hidden and can be viewed only by drilling down to it.

12.  Create a Web Form, place a Crystal Report Viewer control, set its report source to the Crystal Report file and view the report in a browser.  (You can find the detailed steps to achieve in the previous walkthrough - Crystal Report for Visual Studio.NET)

Conclusion

Click here to view how the report should look like in a browser

In the first part of this walkthrough, you have created a Crystal Report file using the Report Expert wizard.  Well … I agree it doesn’t look exactly like the report that was shown at the beginning of this walkthrough.  In the second part, we will take a look at how to modify this report to reflect the actual format that we had in mind earlier.

Crystal Resources

Crystal Alliance

Submitted by

Ajay Varghese & Shankar N.S

Sr. Software Engineers

Jarvis Infotech



User Comments

Title: Good Job   
Name: M Sudhan
Date: 2006-02-17 2:40:38 PM
Comment:
Very good
Title: Very Good   
Name: Yash
Date: 2006-02-08 7:27:29 AM
Comment:
Very gud for begineers...,
Title: Software Developer   
Name: Shrikant Mishra
Date: 2006-01-25 7:10:03 AM
Comment:
Please anyone can send me a complete project or tutorial about generaing crystal reports in inventory.
Title: Mr   
Name: Rsihi
Date: 2006-01-16 1:48:29 AM
Comment:
I will give this article 7 out of 10
Title: Drill Down Option Problem   
Name: Idrees Badshah
Date: 2006-01-13 1:26:10 PM
Comment:
I cannot find drill down option on my crystal reports gallery.i m using crystal report10. can any body tell me and fix this problem
Title: Passing the value to Textobject in the crystal report   
Name: Mukul
Date: 2005-11-26 2:05:13 AM
Comment:
I want to pass the value to the textobject in the crystal report from vb code. I have written the code as:

CrptNSDLRegular.Sections(2).ReportObjects.Item("PER1").Text = ""

PER1 is the textobject name. but I m confused in last means is it Item("PER1").text or something else. please help me
Title: thanks   
Name: din
Date: 2005-11-09 5:45:06 AM
Comment:
thanks alot, this was very helpful but a little more is required
Title: file in video   
Name: veloso@delga.com.br
Date: 2005-11-07 8:19:02 AM
Comment:
File in video (crystalreport1.destination = 0 ) , by the bottom "PRINT" , is desable. How enable the bottom ?
Title: great!   
Name: mj
Date: 2005-10-21 11:10:07 PM
Comment:
great job! more tutorial on crystal report pls!
Title: Crystal reports with VB 6.0   
Name: Kaushik
Date: 2005-10-21 3:04:29 AM
Comment:
How to connect crystal report (.rpt file) with VB environment.
Title: report   
Name: Le Minh Hoa
Date: 2005-10-17 10:17:18 PM
Comment:
Pleased guide to filter in report
Title: very healp full   
Name: dkautilya
Date: 2005-09-30 8:01:22 AM
Comment:
but after execution of the programme it gives error of logon problem i don't know why it is coming
Title: hello sir   
Name: priya
Date: 2005-09-30 7:01:26 AM
Comment:
its nice topic what i need it is there and it is very easy to under stand the subject sir.thank u for helping.
Title: Thanks   
Name: Madhavan
Date: 2005-09-26 12:50:46 AM
Comment:
Article is very useful.

This helped me to understand easily because
I used previous versions of crystal reports.
Title: cong.   
Name: Anoj
Date: 2005-09-23 11:37:02 AM
Comment:
Hello,
It's very nice topic.

Thank U.
Title: How to drill down chart with 2 axes   
Name: Yulan
Date: 2005-09-20 10:38:36 PM
Comment:
Hi.. thank you for this article.Does the Technic that mention in this article can be implemented for chart with two axes.

thanks lot
Title: Nice stuffs   
Name: Shan
Date: 2005-09-13 5:12:28 AM
Comment:
hi
U have done a nice job. it is really very good. Please continue it
Title: Crystal Report   
Name: Vishal
Date: 2005-09-09 6:17:48 AM
Comment:
ActuallY I Have I Existing Crystal Report.If we run The Query The query Is giving a Records but When we Run The crystyal Report so it will not show The Records In The crystal Report
Title: Software Developer   
Name: T.S.Naidu
Date: 2005-08-31 6:38:12 AM
Comment:
Really I thank to You that You gave me good guidence to create Crystal reports on my own
Title: software developer   
Name: tushar
Date: 2005-08-12 4:32:25 AM
Comment:
the article is good but it does provide detailed kowledge
Title: Plese Cleare Following doubts   
Name: Raghavendra Prabhu
Date: 2005-07-09 6:50:16 AM
Comment:
What you explained is good.
But please tell me how to call segate data report using command button, how to add Access tables records to a report and also how to add more than one Ms Access tables to a single crystal report page.
I hope you will mail me about this
thank you
Title: crystal report   
Name: l3p3tit
Date: 2005-06-16 10:28:39 AM
Comment:
i wonder why i can't even find "Drill Down" from the Choose an expert action? i only have "Standard", "Cross Tab", "Mail Label" and OLAP. Anybody help me pleazzzzee
Title: info required   
Name: cammila
Date: 2005-06-13 1:37:21 PM
Comment:
hi gays
i need to print a departmental store slip on 4.0 inch wide on paper roler.
if any body can help me
Title: what is the realted code for connecting crystal report through asp   
Name: code
Date: 2005-04-25 1:14:09 AM
Comment:
please mention code for linking a crystal report through asp
Title: Download Code   
Name: Eric Landes
Date: 2005-04-20 9:52:20 PM
Comment:
For those lookingto download code or more Crystal sites, please check out this url http://aspalliance.com/crystal for more articles and tutorials to walk you through using Crystal with asp.net.

Unfortunately I don't have the source to this article, but I will try to answer questions if I can.
Title: Knowledge less person   
Name: johny
Date: 2005-04-20 1:55:38 AM
Comment:
U should study first the complete Crystal report area before giving solutions to other people.The solutions given are incomplete and nobody understands how they are done
Title: more   
Name: Rhega
Date: 2005-04-13 6:08:01 AM
Comment:
Give me more..........
Title: crystal reports   
Name: kiran
Date: 2005-04-05 4:17:05 PM
Comment:
its very good
Title: Great work   
Name: Someone
Date: 2005-03-08 6:56:38 PM
Comment:
Hi Ajay,

You are doing greate job , please do not take some of the
comments on you mind as they are coming from lazy people
whoe never appriciate anything.
Please keep doing good work .....really nice tutorial

Thank you
Title: Hameed   
Name: Javed
Date: 2005-02-03 10:04:03 AM
Comment:
Please anyone can send me a complete project or tutorial about generaing crystal reports.
Title: Details   
Name: Mythilla Raj
Date: 2005-02-02 2:56:49 AM
Comment:
Could anyone recommend a good site for learning about Crystal Reports. Could 2 or more reports be presented in the same ASP page ?If so how?Please revert at the earliest
Thanks in Advance
Regs,
Mythilla
Title: Learning stage   
Name: mit
Date: 2005-01-20 2:50:23 PM
Comment:
Hi,
It is really very useful to me.I know asp.net very well.But I thought that crystal report is very tough to learn.Today only Itried this report.After your article ,I felt its very piece of cake. Thanks a lot.
Title: Mr.   
Name: Jim A.
Date: 2005-01-04 2:34:20 AM
Comment:
This article does not work with passing multiple parameters. Reporting Services 2005 is highly recommended.
Title: Thaaaaaaaaaaaanks   
Name: Salamin
Date: 2004-09-08 1:52:14 AM
Comment:
Great Job !
You saved me man, I learned all these features in a record time, Just what I needed!

Product Spotlight
Product Spotlight 



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


©Copyright 1998-2020 ASPAlliance.com  |  Page Processed at 2020-11-28 9:04:01 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search