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! |
You'll get answers to many questions and more from David Barnes, Lead Evangelist for IBM Emerging Internet Technologies. David will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
|
|
|
|
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!
|
|
|
|
Visit IBM developerWorks to download a free trial of the latest release of IBM Lotus Sametime Standard V8.0. Lotus Sametime Standard V8.0 is a platform for unified communications and collaboration that combines security features with an extensible, open solution including integrated Voice over IP, geographic location awareness, mobile clients, and a robust Business Partner community offering telephony and video integration. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial version of WebSphere Extended Deployment Compute Grid, which lets you schedule, execute, and monitor batch jobs. Because online transaction processing and batch jobs execute simultaneously on the same server resources, you can avoid costly duplication of resources. Compute Grid supports job types of Java transactional batch, compute-intensive and a new type called "native execution", which enables non-Java workloads to run on distributed end points. FREE! Go There Now!
|
|
|
|
Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs). FREE! Go There Now!
|
|
|
|
Regression testing -- in which code is thoroughly tested to ensure that changes have not produced unexpected results -- is an important part of any development process. But many testing environments neglect the terminal-based applications that still form the backbone of many industries. In this tutorial, you'll learn how the Rational Functional Tester Extension for Terminal-Based Applications works with other Rational Functional Tester to help test terminal-based applications quickly and easily. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services. FREE! Go There Now!
|
|
|
|
As businesses grow increasingly dependent upon Web applications, these complex entities grow more difficult to secure. Most companies equip their Web sites with firewalls, Secure Sockets Layer (SSL), and network and host security, but the majority of attacks are on applications themselves – and these technologies cannot prevent them. This paper explains what you can do to help protect your organization, and it discusses an approach for improving your organization’s Web application security. FREE! Go There Now!
|
|
|
|
Whether you are creating new applications or modifying existing ones, managing integration of new components with traditional z/OS elements is a critical part of building and deploying modern applications. Listen to this webcast to see how IBM can help you optimize your development process using an IDE like Rational Developer for System z that integrates with management tools, such as ClearCase to manage your application development on mainframes. FREE! Go There Now!
|
|
|
|
The discipline of assembling and delivering software is maturing beyond standard developer-centric compile/test software builds. The end-to-end software development lifecycle is emerging as the new focus moves “Beyond the Build.” Join this on demand webcast to learn about methods for streamlining software delivery and key capabilities of the IBM Rational Build Forge framework for automating build and release management in environments of any size. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |