In this article I will explain how to generate Crystal Reports using Strongly Typed DataSet in ASP.Net using C# and VB.Net.
Note: By default Visual Studio 2010, 2012 and 2013 does not include Crystal Reports hence you need to download the Crystal Reports 13. Refer my article for details Download Crystal Reports for Visual Studio 2010
Here I am making use of Microsoft’s Northwind Database. You can download it from here
1. Add Typed DataSet to the ASP.Net Website
Since I am using disconnected Crystal Reports we will make use of Typed DataSet to populate the Crystal Reports with data from database.
2. Adding DataTable to the Typed DataSet
Our next step would be to add a DataTable to the Type DataSet.
3. Adding Columns or fields to DataTable
In the DataTable we need to specify the column names that we want to display in the Crystal Report.
Note: The Column Names of the DataTable must exactly match with the actual Database Table column names.

By default all the columns are of String Data Type but you can also change the data type as per your need.
4. Add Crystal Report to the ASP.Net Website
Now you will need to add a Crystal Report to the ASP.Net Application. You can give it name as per your choice.
As soon as you click OK you get the following dialog. You must select Using the Report Wizard option.
Once you press OK in the above dialog, the Report Wizard starts and you get the following dialog where you need to choose the type of Database connection for your Crystal Report. Since we are using DataSet we will choose the Customers DataSet.
Next the Wizard will ask for the Columns or Fields from the Customer DataSet you need to display on the Crystal Reports. You can choose either all or specific fields as per you choice.
Note: There are more steps in the Wizards but those are Optional hence are not included in this article.

Once you click Finish your Crystal Report should look as below
HTML Markup
The HTML Markup is simple and contains a CrystalReportViewer control.
<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />
You will need to import the following namespaces.
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Populating the Crystal Report from Database
I am populating Crystal Reports from database in the Page Load event of the page using the following code
protected void Page_Load(object sender, EventArgs e)
    ReportDocument crystalReport = new ReportDocument();
    Customers dsCustomers = GetData("select * from customers");
    CrystalReportViewer1.ReportSource = crystalReport;
private Customers GetData(string query)
    string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
    SqlCommand cmd = new SqlCommand(query);
    using (SqlConnection con = new SqlConnection(conString))
        using (SqlDataAdapter sda = new SqlDataAdapter())
            cmd.Connection = con;
            sda.SelectCommand = cmd;
            using (Customers dsCustomers = new Customers())
                sda.Fill(dsCustomers, "DataTable1");
                return dsCustomers;
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim crystalReport As New ReportDocument()
    Dim dsCustomers As Customers = GetData("select * from customers")
    CrystalReportViewer1.ReportSource = crystalReport
End Sub
Private Function GetData(query As String) As Customers
    Dim conString As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
    Dim cmd As New SqlCommand(query)
    Using con As New SqlConnection(conString)
        Using sda As New SqlDataAdapter()
            cmd.Connection = con
            sda.SelectCommand = cmd
            Using dsCustomers As New Customers()
                sda.Fill(dsCustomers, "DataTable1")
                Return dsCustomers
            End Using
        End Using
    End Using
End Function