Results 1 to 2 of 2

Thread: crystal report in ASP.net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    95

    crystal report in ASP.net

    hai,

    im using Crystal report in my asp.net page. wat is the concept and how to display crystal report in asp page.

    plase provide me some good examples on crystal report


    v.r.mahendran

  2. #2
    Addicted Member cutamacious's Avatar
    Join Date
    May 2001
    Location
    INDIA >> Andhra Pradesh >> Hyderabad
    Posts
    185

    Re: crystal report in ASP.net

    Originally posted by mahivr
    hai,

    im using Crystal report in my asp.net page. wat is the concept and how to display crystal report in asp page.

    plase provide me some good examples on crystal report


    v.r.mahendran
    Well.. For using crystal report we need to have typed dataset on the page. First create a new connexion (say con) , dataadapter(say daEx) and typed dataset ( say dsEx1).

    Then Design a Crystal Report and add it to your project. This can be done using the Add New Item in the Project Menu. In the resulting dialog select the CrystalReport Option ( The Crystal Report comes with Visual Studio .Net U dont need to install anything). A wizard will be poped up to ghuide you thru the process of creating the report. Say teh Name of the Crystal Report is CrystalReport1.rpt.

    Then place a CrystalReportViewer Control ( found in the toolbox --> WebControls Tab say CrystalReportViewer1) on to your form. Donot make any changes to the properties of the CrystalReportViewer Control.

    Then place a reportDocument Control (found in the Components tab of the toolbox say reportDocument 1) on the form.

    Whenever u want to show the report letus say in button1 click event write

    reportDocument1.Load(MapPath("CrystalReport1.rpt"))
    reportDocument1.SetDataSource(dsEx1)
    CrystalReportViewer1.ReportSource = reportDocument1

    That it u r done with showing crystal report.



    Note: If you r using .Net 2002 U might get a NullReference Exception. The only thiing I know to get rid of this exception is to upgrade to .Net 2003
    Cute Member

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width