.NET
  Home arrow .NET arrow Page 3 - Using CrystalReportViewer to Display Cryst...
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 
Mobile Linux 
App Generation ROI 
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? 
.NET

Using CrystalReportViewer to Display Crystal Reports in .Net
By: Madhuri Chanda
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2008-10-07

    Table of Contents:
  • Using CrystalReportViewer to Display Crystal Reports in .Net
  • Binding with the Report Source Property
  • Binding with Code
  • Toolbar Functions

  • 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


    Using CrystalReportViewer to Display Crystal Reports in .Net - Binding with Code


    (Page 3 of 4 )

    • You can also bind the report to CrystalReportViewer at run time programmatically.


    The following lines of code can be added to the form's load event to bind the Crystal Report to the Viewer.

    CrystalReportViewer1.ReportSource = "C:CrystalReportViewerTestCrystalReport1.rpt"


    In the above code, "CrystalReportViewer1" is the name of the viewer object, "ReportSource" is the property to be set at run time for the Viewer. "CrystalReportViewerTest" is the name of the Windows application, and "CrystalReport1.rpt" is the name of the report already created in the Windows application.

    Binding Crystal Reports at runtime is very beneficial, as we don't have to create forms for each and every Crystal Report in an application. We can simply create one form and bind the required report dynamically when necessary.

    Sometimes we have multiple reports in an application, and we need to display a particular report depending upon the user's selection. In such cases, to create Crystal Reports dynamically, we use this type of binding.

    Once you have bound your report to the viewer, you should run your application with the start form as the form to which the report is bound. You will see you report, which should look something like this: 



    You can see a tool bar at the top of the report with different buttons.

    More .NET Articles
    More By Madhuri Chanda


     

    .NET ARTICLES

    - Using CrystalReportViewer to Display Crystal...
    - Creating Summary .Net Crystal Reports
    - More on Commands, Input and the WPF
    - Grouping and Aggregating When Querying LINQ ...
    - Commands, Input and the WPF
    - Keyboard and Ink Input with WPF
    - Mouse Input and the WPF
    - Input with Windows Presentation Foundation
    - Introducing LINQ with XML and Databases
    - An Introduction to LINQ
    - Querying LINQ to SQL: Basics
    - Completing a Simple Storefront with LINQ
    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT