In this article I am going to show how we can show our data in chart form in a crystal report. Here in this example I am going to show data fromResourceManagement Table design as below.

Image 1.
Data in my table.

Image 2.
Now Open Visual Studio -> File -> New -> Web Site. -> Select ASP.Net website -> OK

Image 3.
Now Right Click on Solution Explorer -> Add New Item -> Select Crystal Report

Image 4.

Image 5.
Here click on Create New Connection -> Select OLE DB (ADO) -> Double Click here A Popup window will open.

Image 6.
Select Microsoft OLE DB Provider for SQL Server here.

Image 7.
Here give your SQL Server information and select your DB.

Image 8.

Image 9.
Now Select your DB -> Select your Data Table and move it into Right side.

Image 10.
Now select your Data Column and Click on Finish.

Image 11.
Now we will do some setting to show data graphically. Right Click On Page Header and Details And click on -> Suppress to hide because we are showing here only Chart.
Not in Menu -> Crystal Report -> Insert -> Chart

Image 12.
In Type Unchecked Automatically set chart options. Now here Select Bar

Image 13.
Now click Data. Here select onChange. Now Select your fields to show in chart.

Image 14.
Now Select Axes and do the below settings.

Image 15.
Now select Options and select format.

Image 16.

Image 17.
Now set Text font etc.

Image 18.
Now Drag a Report Viewer on your aspx page:

Image 19.
Now aspx is:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Chart in Crystal Report</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
DisplayGroupTree="False" />
</div>
</form>
</body>
</html>
aspx.cs is:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(Server.MapPath("ResourceManagementReport.rpt"));
CrystalReportViewer1.ReportSource = cryRpt;
}
}
Now Run application:

Image 20.
If your chart is not displaying the in web.config do the following change?
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
</httpHandlers>