Using Crystal Reports and ASP.NET to Create Drill through Reports and Graphs
page 6 of 7
by Vince Varallo
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 41273/ 54

Step 5: Create the page footer section

That was pretty easy.  Now let's change the report so that it displays a pie chart that a user clicks on to drill through instead of clicking on the numbers.

1.    Close your browser to stop debugging.

2.    Open the Sales.rpt report in Visual Studio.

3.    Right click on an empty location in the report and select InsertàChart from the pop-up menu.

4.    The Chart Expert should appear.  Choose Pie Chart for the Chart type.  Click on the Data tab.

5.    Change the placement to Footer.  Make sure the CountryRegion.Name is selected in the On Change of drop down list.  Make sure the Sum of SalesOrderHeader.TotalDue is selected in the Show drop down list.  Click the OK button.

6.    Right click on an empty location again in the report and select InsertàChart from the pop-up menu.

7.    Choose Pie Chart as the Chart Type and click on the Data tab.

8.    Change the Placement to For each CountryRegion.Name change.

9.    Choose the Footer option for the placement.  Make sure StateProvince.Name is selected in the On change of drop down list.  Make sure the Sum of SalesOrderHeader.TotalDue is selected in the Show drop down list.  Click the OK button.

10. Right click on an empty location again in the report and select InsertàChart from the pop-up menu.

11. Choose Pie Chart as the Chart Type and click on the Data tab.

12. Change the Placement to For each StateProvince.Name change.

13. Choose the Footer option for the placement.  Make sure Address.City is selected in the On change of drop down list.  Make sure the Sum of SalesOrderHeader.TotalDue is selected in the Show drop down list.  Click the OK button.

14. Now you need to define the entry point to the report and the links.

15. Right click on the graph in ReportFooterSection1. 

16. Select Copy from the pop-up menu.

17. Right click on an empty location in the report and select ReportàReport Options… from the pop-up menu.

18. Click the Paste Link button.  This should add Graph1 to the Object Name text box.  Click the OK button.

19. Right click on the Graph in ReportFooterSection1.  Select FormatObject from the pop-up menu.

20. Click the Hyperlink tab.  Select the Report Part Drilldown option.

21. Expand GroupFooter#1a and move the Graph2 object to the Fields to Display list.  Click the OK button.

22. Right click on the Graph in GroupFooterSection4.  Select FormatObject from the pop-up menu.

23. Click the Hyperlink tab.  Select the Report Part Drilldown option.

24. Expand GroupFooter#2a and move the Graph3 object to the Fields to Display list.  Click the OK button.

25. Right click on the graph in GroupFooter#2a.  Select FormatObject from the pop-up menu.

26. Click the Hyperlink tab.  Select the Report Part Drilldown option.

27. Expand Group Footer #3 and move the GroupNameCity2 and SumofTotalDue3 to the Fields to Display list.  Click the OK button.

Run the project again and you should see the following page.

Click on Canada and you will see a pie chart of the Provinces in Canada.

Click on Quebec.  This will show you a pie chart of the cities in Quebec that have placed orders.

Click on Brossard.  This will show you the total for Brossard.

Click on the $719,967.81.  This will display the details of the orders from Brossard.


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
Comment:
Hi

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

Example:
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
Comment:
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
Comment:
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
Comment:
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
Comment:
This is very good........
i m agree whith this. all the way
Thanku......so much
Title: Problem in chart   
Name: kamlesh makvana
Date: 2010-09-14 3:58:12 AM
Comment:
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
Comment:
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 asp.net visual studio 2008 sp1   
Name: MFiaz
Date: 2010-06-17 7:23:08 AM
Comment:
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 asp.net 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 ASPAlliance.com  |  Page Processed at 2024-03-28 7:05:35 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search