To Display the data crystal Report

Last Reply on Feb 21, 2013 05:06 AM By Mudassar

Posted on Feb 21, 2013 05:05 AM

Hai Techie


I have created a following crystal report to show the details of a table.
Crystal report runs perfectly but does not show data


The code is


SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Iwens_Database; Trusted_Connection=yes");
SqlCommand cnd = new SqlCommand("SELECT E_id, E_Name, E_Address, E_Contact_No, E_Email, DOEn, E_noi, E_coursename, E_year, E_companyname, E_design, E_others, E_Selected, E_Followup FROM Enquiry_table", con);


SqlDataAdapter sda = new SqlDataAdapter();

DataSet eds = new Enquids();


ReportDocument rdoc = new ReportDocument();
sda.SelectCommand = cnd;
DataTable dt = eds.Tables[0];
sda.Fill(eds, "enquirypartfollowp");
rdoc.Load(Server.MapPath("Enquirybydate.rpt"));
rdoc.SetDataSource(eds.Tables ["Enquiry_table"]);
eds.Tables[0].TableName = "Enquiry_table";
CrystalReportViewer1.ReportSource = rdoc;
CrystalReportViewer1.RefreshReport();

Posted on Feb 21, 2013 05:06 AM Modified on on Mar 04, 2013 04:03 AM

There can be two problems

#1. Your Query is not returning data.

#2. You are not filling correct datatables

For more reference refer

Crystal Report ASP.Net Example using DataSet or DataTable in C# VB.Net and Visual Studio 2010