Create and Bind Crystal Reports in ASP.Net without Dataset.

Here, we learn how to create crystal reports in asp.net, and how to bind data to crystal reports from sql server database.  here we are bind data to crystal reports in ASP.Net without use of Dataset.

For binding data to crystal reports, first we must need to create a new database in sql server and create a table in database. Here we need not to create stored procedure for binding crystal reports.

Here, first we create new Database in sql server and create new Table within a Database.

– Create a new Table “DEMO” in SQL – server with some columns.

Create New Table in SQL-Server Database
Create New Table in SQL-Server Database

Here, We have created new Table UserMSt with Column Name and City.

Create New Table in SQL-Server Database
Create New Table in SQL-Server Database

Now , after create new database and table in sql server, now create a new asp.net web application for bind crystal reports.

Create New ASP.Net web application with C#
Create New ASP.Net web application with C#

– Add CrystalReportViewer on asp.net web forms from Toolbox for Display crystal reports.

Add CrystalReportViewer in asp.net webfom
Add CrystalReportViewer in asp.net webfom

Now, Right click on Project Title and go to Add New Item and select Crystal Report for add new Crystal Report in asp.net. here we can change the crystal reports name as our need.

Add New Crystal Report in ASP.Net
Add New Crystal Report in ASP.Net

When we Add new crystal reports, we have three options here select As a Blank Report and click OK.

Select As a Blank Report Property in Crystal Reports in ASP.Net
Select As a Blank Report Property in Crystal Reports in ASP.Net

Now, here we have created crystal reports now for binding data to crystal reports we have to do some step.

Field Explorer >> Database Field >> Database Expert >> Create New Connection >> OLE DB (ADO)

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

In database Expert select OLE DB (ADO) option in Create New Connection option then click OK Button to go next step.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

Here, we have list of Database Server Provider for choose our appropriate database provide.

Select Microsoft OLE DB Provider for SQL Server click next to go ahead.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

Fist check (tick) the Integrated Security  option check box and then write the your Sql Server name like ComputerName/ServerName.

Here we have write .\NEWSQLEXPRESS indicate the sql server name. if we write right sql server name then all the Database of this server will be automatically displayed in below Database Dropdownlist.

Select your Database which you want to display in crystal reports and click next button to go ahead.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

here, we do nothing, just click finish button to finish the sql server connection process.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

Now, We have already connect the DEMO Database in our asp.net web application crystal reports Database Expert field.
Here, we can see all the table of DEMO Database, just add the table for display crystal reports by clicking arrow button.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

We can see here UserMst Table already added for bind crystal reports.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

now, just design the crystal reports with name and city columns like below screen.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

we can see the crystal reports preview without run the asp.net web application, just click the Main Reports Preview button.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

Here, is the final crystal reports out put of asp.net web application.

Create and Bind Crystal Reports in ASP.Net using C#
Create and Bind Crystal Reports in ASP.Net using C#

3 thoughts on “Create and Bind Crystal Reports in ASP.Net without Dataset.

Leave a Reply to wwei Cancel reply

Your email address will not be published. Required fields are marked *