Create Reports using Crystal Reports in Visual Studio 2010
- First we need to make a new project by selecting
new project from file menu.
Now we will select Reporting tab from Installed Templates and select Crystal
Reports Applications, give it a Name, click on Add and then click Open. Now, the
Crystal Reports Gallery Dialog Box will open.
It will have three options:
- Using the Report Wizard.
- As a Blank Report
- As an Existing Report.
- Select Using the Report Wizard, choose
Standard for Choose an Expert Option, choose Ok. From available Data
Sources, select Create New Connection Folder, expand it and select OLEDB
(ADO). From list of providers, select Microsoft OLE DB Provider for SQL
Server. Now fill the User Id, Password and database fields and click Finish.

- Now click + sign on the OLE DB folder. It will show database
server, and database you have made. Click + sign on database , dbo and table and then select
table you have made. Now click the > symbol. Now table will show in the Selected Tables option on right
side. Now click Next. Click > symbol. By doing this, fields of table will be shown
in the fields in Fields to Display. Click Finish. Now expand Database Fields from Field Explorer, select your
table Fields and drag them one by one into Details section of your .rpt file.

- Now add
Windows Form from Project menu. Drag Crystal Report Viewer from Toolbox onto
form. Now on Form load event write following code:-
private void crystalReportViewer1_Load(object sender, EventArgs e)
{
CrystalReport1 report = new CrystalReport1();
crystalReportViewer1.ReportSource = report;
}
Now run it. You will see crystal report now.
