Creating Professional Reports using Crystal Report for Visual Studio.NET (Part 1)
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.
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.
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.
Links Tab
4. The Links tab displays the current table linking. Stick to the default settings.
Fields Tab
5. The Fields tab allows you to specify the fields that should be displayed on your report. Select the fields that are shown in the screen snapshot.
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
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
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
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.
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)
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.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP.NET Articles
More By aspfree
developerWorks - FREE Tools! |
Hear how IBM Rational Project and Portfolio Management integrated solutions help teams put the right tools and processes in place to maximize the effectiveness and efficiency of project teams and ensure that the business vision is being executed correctly. Learn how to automate and integrate requirements prioritization, top-down project planning, communications and controls, and methodology deployment to keep your scope, costs, and schedules under control. Tackle with an end-to-end approach the management of scope and scope changes, usage of methodology to control and empower project teams, and optimization of resources to align activity costs with the overall project plan. FREE! Go There Now!
|
|
|
|
CakePHP is a stable production-ready, rapid-development aid for building Web sites in PHP. This "Cook up Web sites fast with CakePHP" series shows you how to build an online product catalog using CakePHP. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages. FREE! Go There Now!
|
|
|
|
Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications. FREE! Go There Now!
|
|
|
|
This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product. FREE! Go There Now!
|
|
|
|
Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available. FREE! Go There Now!
|
|
|
|
This whitepaper provides areas to consider when evaluating any software configuration management solution. It addresses how the IBM solutions (Rational ClearCase and Rational ClearQuest) meet the needs and requirements of both project leaders and developers to provide successful Software Change and Configuration Management. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Performance Tester V7.0.1, a load and performance testing solution for teams concerned about the scalability of their Web-based applications. Combining multiple ease-of-use features with granular detail, Rational Performance Tester simplifies the test-creation, load-generation and data-collection processes that help teams ensure the ability of their applications to accommodate required user loads. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to try the IBM SOA Sandbox for connectivity. The SOA Sandbox for connectivity provides a trial environment with the tooling and components to help you explore how to effectively connect your infrastructure and integrate all of the people, processes and information in your company. Use the hosted sandbox to explore SOA techniques that streamline connecting existing IT assets together, as well as learn how to connect them to new business logic. FREE! Go There Now!
|
|
|
|
Join this webcast to learn how IBM Rational's Functional Testing solution enables you to implement automation your way, at your pace, with your existing staff. In this webcast, you’ll learn how you can eliminate redundancy of manual test scripts, reduce errors, and increase test coverage through test automation. After this presentation you will understand how IBM Rational Functional Testing solution can streamline your manual testing and make test automation easily attainable. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |