C#
  Home arrow C# arrow Page 4 - Creating Graphical Reports With Crystal Re...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
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? 
C#

Creating Graphical Reports With Crystal Reports in .NET
By: Wrox Team
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 151
    2002-11-10

    Table of Contents:
  • Creating Graphical Reports With Crystal Reports in .NET
  • The Database
  • Creating Web Pages
  • The Report
  • Creating Report Parameters
  • Passing Parameters to a Report
  • Conclusion

  • 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
     
     
    ADVERTISEMENT


    Creating Graphical Reports With Crystal Reports in .NET - The Report


    (Page 4 of 7 )

    We will create our report using Visual Studio .NET and will save it in a .rpt file. The code above is actually redirecting the user towards the report page that will display the report.

    Create a new web page called ViewReport.aspx. From the toolbox drag the Crystal Report Viewer control on the form and name it crViewer. Here is how it looks:



    In the properties window you will find some properties like DisplayToolbar, EnableDrillDown, EnableViewState. These properties help us to customize our report; for this example we set them all as false. We also need to write some code to pass the arguments to our report like the ItemId, StartDate and EndDate, which we will do later. Save the form and close it. Before we go any further, we will create the report.

    Creating the Report
    Right click on the solution name in the project explorer and click Add | Add New Item | CrystalReport. Name it ItemReport. Next we will be asked to select how our report is created. We will use the Report Expert, which is the default option. From the down options we can select the format of your report. Select "Standard" which is again the default. The next screen shows this:



    We then have to select our data source. Select OLEDB (ADO) | Microsoft OLE DB Provider for SQL Server | Next. We need to provide the Server name, our UserId and Password, and the database to which we want to connect. After providing the information, click Finish.

    Now you need to select the tables to which we will be displaying data. For our example, select "tblSales " only because all the data we need is from this table. Here is the screen.



    Click Next to proceed. Now we have to add the fields to be displayed in the report. Select SaleDate and Amount. Click Next we will be offered the option to Group the information on the report using a Group By clause. We do not need this so just click Next again.

    Next we have to select our chart type. There are a large number of different charts available. For our example, select Line and the first chart type and click Finish.



    This is what you will see.



    Right click on the Page Header area and click Insert | Chart. We will see a screen that we have already seen before. Click on the Data tab.



    We mention here that we want only one chart in our report. Then we provide our SaleDate field under the On change of column. Note that we mention both the fields that we want to be displayed (SaleDate and Amount). Click on the Text tab and select a suitable Title for your report. Click Ok and we are almost done. We need to set the output parameters our code will query - so let's do that next.

    More C# Articles
    More By Wrox Team


       · Hello i want to download the code for following topic.Creating Graphical Reports...
       · best one to know the technical details
       · good one for starting..
       · How can i download source of this article..
     

    C# ARTICLES

    - Introduction to Objects and Classes in C#, P...
    - Visual C#.NET, Part 1: Introduction to Progr...
    - C# - An Introduction
    - Hotmail Exposed: Access Hotmail using C#
    - Razor Sharp C#
    - Introduction to Objects and Classes in C#
    - Making Your Code CLS Compliant
    - Programming with MySQL and .NET Technologies
    - Socket Programming in C# - Part II
    - Socket Programming in C# - Part I
    - Creational Patterns in C#
    - Type Conversions
    - Creating Custom Delegates and Events in C#
    - Inheritance and Polymorphism
    - Understanding Properties in C#







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