.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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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 / 20
    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


       · Good article but I can't find anywhere the information as to programmatically...
       · we can export report programatically by using following...
     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek