Mar 23, 2008 10:15 AM|Stalin.VG|LINK
Creating Crystal Report in ASP.NET with DataSet
First we need to create a DataSet
Right click on website name in solution explorer and select ADD NEW ITEM from that select DATASET.
Always give meaningful name to your dataset because we need to refer the same in our code, here I’ve given “DS_Northwind”
After that, Add Table adapter s in the DATASET. Here also we have to give meaningful name for our Table adapter, Data Table and for the Method
Save the Dataset and now we have our DataSet. Now we have to add a crystal report and a webform to our project.
Add crystal report from the template
and give report name accordingly.
Click “ADD” button. Now you’ll see the following screen.
Accept the default setting and click OK. From there we’ll point out our Dataset for report’s source
Select “ADO.NET Datasets” as your project Data and select the dataset what we created early Now press “>”
and click Finish. You can click next too to select fields to display in the report. At this time we are going to do that manually.
From field explorer, add required field into your report and set space accordingly.
Now we are going to add chart into our report. Select
chart from the toolbar
After clicking this you’ll get chart construction panel. See the fig.
Select chart type and press the DATA Tab to define values for chart
I used Product Name and the unit price as my Data for the chart.
We can change caption, series heading etc in TEXT tab. Now click ok.
Now we need to place the fields from database field to our report by dragging them to our report. The heading will be changed further meaningfull otherwise it shows the Database
field name by default.
Now I added the database fields and changed the Heading.
Now we need to add web form to display the report.
Add Crystal Report viewer into the added web form.
This is the ASPX.CS page(Code Page)
Crystal Report Using DataSet
Crystal report C#