Click here to Skip to main content
15,885,630 members
Articles / Programming Languages / C#
Tip/Trick

How to create a Crystal Reports report from a dataset

Rate me:
Please Sign up or sign in to vote.
3.75/5 (4 votes)
28 Jun 2011CPOL 51K   8   4
Creating a Crystal Reports report from a dataset

First create a CrystalReportViewer and then CrystalReport. Create a dataset, and in the dataset, create a table using the table adapter tool. Add columns in the table. The content of the table must be same as the content that is retrieved. Now consider report viewer as rpviewer and report as rpt. Write the code below to bind the dataset with the crystal report (rpt).


C#
Query = .....;
adapter.fill(datasetname,"table name of the dataset");
rpt.setdatasource(datasetname);
rpviewer.reportsource = rpt;
rpviewer.refresh();

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Sundaram Infotech
India India
I am a Software Specialist.Worked & Working in Various IT Based industries.I have good Exposure in ASP.net, C# and other Microsoft Technologies.

Comments and Discussions

 
QuestionSharing more links crystal reports Pin
heemanshubhalla1-Aug-14 9:31
heemanshubhalla1-Aug-14 9:31 
Questionhow to use crystal report step by step use asp.net Pin
sirisiri16-Mar-12 1:32
sirisiri16-Mar-12 1:32 
Generalcan you show how to make multiple detail of report? Pin
vachzar4-Jul-11 19:58
vachzar4-Jul-11 19:58 
GeneralAgain, What's new in it? Ain't it a standard way to do it? A... Pin
Sandeep Mewara8-Aug-10 3:18
mveSandeep Mewara8-Aug-10 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.