How To Create Crystal Report In C#

 

1). Create XML File That Used In this Reports.

So,How To Create That XML File.

1). To Creating that XML Using Dataset.

2). First Fill Dataset From DataAdapter.After That there is one property WriteXMLSchema Of Dataset.In this Property write the XML FIle Name.

2). After Creating that XML File.Right Click On Project And Click On  Add New Item.While Click On that One Open Dialog Box Appear.From that Dialog Box Click On Crystal Report.That will Add One Crystal Report On your Solution.

3). After Creating Rpt File Follows That Following Steps.

1). Add Datasource Of that newly created Crystal Report And Click On Database Expert… link.

 

 

 

 

 

 

 

 

 

 

2). Click On That One Dialog Box Appear that Describe below.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3). When Expand that Database files Option It will ask the Location Of that XML give.Give the location Of that XML File.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4). After Click On Open Button This Screen Appear.From That Choose the Table that will see on that Report.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4). All This Task Complate That Write the below code For Bind the Data To ReportViewer .

ReportDocument rdoc = new ReportDocument();

// Path Of That Report Document File In Load Function Parameter.
rdoc.Load(@”C:\Documents and Settings\xosysadmin\My Documents\Visual Studio 2005\Projects\GivingXMLToRpt\GivingXMLToRpt\Testrpt.rpt”);

// Give the Dataset Name That Assing To Report Document
rdoc.SetDataSource(ds);

// Viewer Name . ReportSource = That Report Document Object Name
crystalReportViewer1.ReportSource = rdoc;

Advertisements

10 thoughts on “How To Create Crystal Report In C#

  1. RajuBabu

    I have 7 select statements in stored procedure. I taken that procedure into dataset with 7 tables. Now I don’t know how to bind that dataset to report. In report they show some garbage values.

  2. bhavinshah

    hi

    would you pls know how to pass parameter in crystal report in c#(Asp.net) .

    if yes can u pls send me code

    Regards,
    Bhavin shah

  3. Dhaval Patel

    hey hello can u please me tell me step by step process to add crystal report on my project i don’t know how to add crystal report in project.

  4. Prashant Tandon

    This is great stuff which you have make very simple and understandable. It helped me lot, thanks for sharing with us. There are also some good articles which I was found over internet, these articles helped me in completing my task. For more information about these article check this links…..

    http://www.mindstick.com/Articles/debc8ff7-ba0e-489c-9ebe-10dcefbef5a7/?Creating%20Crystal%20Report%20in%20C#.Net

    http://www.c-sharpcorner.com/uploadfile/mahesh/crystalreportsintroduction11082005014959am/crystalreportsintroduction.aspx

    http://www.codeproject.com/Articles/12694/Creating-Crystal-Reports-using-C-with-Datasets

    Thanks Everyone for your nice post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s