C#
  Home arrow C# arrow Crystal Reports for Visual Studio 2005 in ...
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? 
C#

Crystal Reports for Visual Studio 2005 in CSharp
By: MSDN Virtual Labs
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 57
    2006-02-02

    Table of Contents:
  • Crystal Reports for Visual Studio 2005 in CSharp
  • Exercise 2: Creating a Custom Stock Market Information
  • Exercise 4: Bind your Crystal Report to the Crystal Report Viewer
  • Exercise 5: Adding Data Dynamically to the Stock Report
  • Exercise 6: Adding Charts and Summary Information to the Report

  • 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

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Crystal Reports for Visual Studio 2005 in CSharp


    (Page 1 of 5 )

    This article, written by MSDN Virtual Labs, guides you through the creation of a Crystal Reports web application that reports off of data from an Object Collection. You will create a unique class to hold stock market values, instantiate the class, and more.

    Objectives

    After completing this lab, you will be better able to:

    • Create a unique class to hold stock market values.
    • Instantiate the class.
    • Populate and object collection with data.
    • Dynamically add data through a web form.
    • Create a crystal report with the Crystal Report Designer.

    Scenario

    This lab guides you through the creation of a Crystal Reports web application that reports off of data from an Object Collection. The application is developed with Crystal Reports for Visual Studio 2005 Beta 2.

    Then you will create a unique class to hold stock market values, instantiates the class and populates an object collection with data, and dynamically adds further data through a web form. You will then create a Crystal report with the Crystal Report Designer control that connects to the object collection and dynamically generates a chart and stock summary

    Estimated Time to Complete This Lab

    60 Minutes

    Exercise 1: Web Application Setup

    Scenario

    In this exercise, you will create a new Web Site and apply the standard settings needed to complete the lab.

     Tasks              Detailed Steps

    1. Create the Web site in this section you will create a new ASP.NET Web Site in Visual Studio.

      1. Double-click the  Visual Studio 2005 Beta 2 shortcut on the desktop.

      2. Click File | New | Web Site.

      3. In the New Web Site dialog box, click ASP.NET Web Site.

      4. In the Location list, select File System.

      5. In the Language list, select Visual C#

      6. In the Location text field, accept the default path and name.

      7. Click OK.

    2. Adding the Crystal Report Viewer Control.

      1. From the Solution Explorer, double click Default.aspx to open the web form.

      2. Click the Design button at the bottom of the form to change the Web Form to Design view.

      3. From the Toolbox, expand the Crystal Reports node and locate the CrystalReportViewer control.

      4. Drag the CrystalReportViewer control onto the Web Form.

      5. If the Smart Task panel CrystalReportViewer Tasks is open, press Esc on your keyboard to close it.

        The Smart Task panel is a new feature to Visual Studio 2005 that allows for a reduced code approach to creating projects. In this lab, you will use a programmatic approach, and thus will not use the Smart Task panel. 

      6. Click the Properties tab and select the CrystalReportViewer

      7. From the Properties window, set the ID property to crystalReportViewer

      8. From the File menu, click SaveAll.

    3. Adding the Programmatic Settings.

      1. Click the Solution Explorer tab. 

      2. In the Solution Explorer, right click Default.aspx and click View Code.

      3. Above the class signature, add a "using" declaration for the namespaces of the assemblies that are listed below.

        using CrystalDecisions.CrystalReports.Engine;
        using CrystalDecisions.Shared;

      4. Within the class, add a new private scope helper method, with no return value, named ConfigureCrystalReports().

        private void ConfigureCrystalReports()
        {
        }


        ConfigureCrystalReports() is a helper method that interacts with the report at runtime. It also controls programmatic interaction with the report. In order to correctly configure the CrystalReportViewer, it must be called from Page_Init().

      5. Add the Page_Init event handler. Use the exact syntax shown.

        private void Page_Init(object sender, EventArgs e)
        {
        }


        In a C# Web form in Visual Studio 2005, the Page_Init event handler in the code-behind class is automatically wired to the Init event. The event handler signature must match exactly in order to be called.

      6. Finally, within the Page_Init event handler, enter a call to the ConfigureCrystalReports() helper method.

        ConfigureCrystalReports();

      7. From the File menu, click Save All.

        You are now ready to create your custom stock market information class.

    Take Microsoft software for a test drive. With MSDN Virtual Labs, you get full access to all available Microsoft products through 90-minute modules, each with its own downloadable manual. Try this lab out now.

    More C# Articles
    More By MSDN Virtual Labs


       · We hope you found this article by MSDN Virtual Labs to be enjoyable and educational....
       · This exercise has been followed to the letter and cannot run. It opens with a...
       · hiim very new to asp.net here ..i encountered this msg, No overload for method...
       · I have the same problem too. Answer?
       · I also have this problem. It seems to me that if the report use dataset and/or .net...
       · CAN YOU POST THE STEP BY STEP EXAM FOR WINFORM APPLICATION ? THANK YOU VERY...
       · I encountered the same problem .. pls let me know how to disable the login prompt...
     

    C# ARTICLES

    - Exceptions in C#
    - Overriding versus Overloading
    - Value Types and Reference Types
    - Defining Member and Type Visibility
    - Managing Files in C#
    - Working with Windows Registry in C#
    - Lossless Image Resizing in C#
    - Lossless Image Converting in C#
    - Creating an RSS Feed with ASP.Net Written in...
    - Polymorphism in C#
    - Inheritance in C#
    - C# Events Explained
    - C# Delegates Explained
    - C# StreamReader and StreamWriter Explained
    - C# FileStream Explained

    Click Here




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