Hello,
Please You can Add the below link in your aspx Page and add the folder crystalreportviewer13 in Project.
Copied the crystalreportviewers13 folder from this path and add in your project and add link in your aspx Page.
C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="crystalreportviewers13/js/crviewer/crv.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<cr:crystalreportviewer id="CrystalReportViewer1" runat="server" autodatabind="true" xmlns:cr="#unknown" />
</div>
<div>
</div>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{
ReportDocument crystalReport = new CustomerReport();
Customers dsCustomers = GetData("select * from customers");
crystalReport.SetDataSource(dsCustomers);
CrystalReportViewer1.ReportSource = crystalReport;
CrystalReportViewer1.DataBind();
CrystalReportViewer1.RefreshReport();
}
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;
}
}
}
}