ASP.NET
  Home arrow ASP.NET arrow Creating Professional Reports using Crysta...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Creating Professional Reports using Crystal Report for Visual Studio.NET (Part 1)
By: aspfree
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 19
    2002-02-20

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    IBM developerWorks
     
    ADVERTISEMENT

    Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!

     

    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

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Improve your build process with IBM Rational Build Forge, Part 2: Automate builds for a real-world Tomcat project

    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!


    NEW! Achieving True Agility -- How process can change the behavior of your tools

    Achieving true agility is a never-ending effort. We will showcase how you can become agile incrementally, a few practices at the time.Which practices should any agile team strive to adopt? What additional practices should you consider based on your needs to scale? Adopting practices are however made much easier with the right tool support. What about if your tools adapt to your practices? We will take a look at how the Jazz technology can be leveraged to make your process change the behavior of your tools.
    FREE! Go There Now!


    IBM DB2 Deep Compression ROI Tool

    The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times.
    FREE! Go There Now!


    NEW! Webcast: Extreme transaction processing with WebSphere Extended Deployment

    In this webcast, you'll get an introduction to the eXtreme Transaction Processing (XTP) features of WebSphere Extended Deployment and the common architectural traits required by XTP applications. See how WebSphere Extended Deployment's ObjectGrid feature provides a state-of-the-art infrastructure for hosting XTP applications.
    FREE! Go There Now!


    NEW! IBM Enterprise Modernization Sandbox for System z: Architecture

    Analysts, architects, and developers who have existing COBOL or PL/I skills and want to extend those skills to deploy new workloads on the mainframe can use the IBM Enterprise Modernization Sandbox for System z to find hands-on walkthroughs of common real world scenarios. The scenarios provide examples of how to rapidly design, create, assemble, test, and deploy high-quality Web, Web services, portal, and SOA applications for IBM CICS, IBM IMS, and IBM WebSphere Application Server.
    FREE! Go There Now!


    NEW! Webcast: Striking the right balance between manual and automated testing

    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!


    NEW! Project and Portfolio Management Executive Resource Kit

    Portfolio Management is about effectively managing portfolio value by aligning portfolio investments with business goals. This complimentary e-kit provides a collection of materials that can help you understand how IBM Rational enables and automates best practices for improved governance and clear visibility into portfolio and project performance across the entire IT project lifecycle.
    FREE! Go There Now!


    Role of Integrated Requirements Management in Software Delivery

    As organizations integrate software into every aspect of business, they are constantly pressured to deliver faster, better, and cheaper results. Unfortunately, a “dis-integrated” software delivery approach reduces returns while increasing costs. This IBM Rational White Paper shows how Integrated Requirements Management aligns organizations around maximizing value and keeping pace with change.
    FREE! Go There Now!


    NEW! A Layered approach to delivering security-rich Web applications

    As businesses grow increasingly dependent upon Web applications to provide services to customers, employees and partners, these complex applications become more difficult to secure. Although traditional security solutions protect Internet infrastructure layers, they do not guard against HTTP and HTML attacks. Many organizations that conduct security testing still deploy applications that allow attackers to manipulate their logic and wreak havoc on their business. To mitigate this risk, development and delivery teams must address Web application security throughout the lifecycle, addressing the many layers detailed in this paper.
    FREE! Go There Now!


    NEW! Rational Talks to You: Grady Booch on Architecture

    Join this Rational Talks to You teleconference on November 29 at 1:00 pm ET to participate in an interactive discusssion with Grady Booch around architecture and reuse. Get your questions answered!
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP.NET ARTICLES

    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...
    - Back-end Management Tasks for an ASP.NET AJA...
    - User Information Management for an ASP.NET A...
    - Adding Comments and Search to an ASP.NET AJA...
    - Order-Related Modules for an ASP.NET AJAX Se...
    - User and Role Management for an ASP.NET AJAX...
    - Programming an ASP.NET AJAX Server-Centric B...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway