3
Answers

Crystal report is not loading from the specified path

mohammed zubair

mohammed zubair

6y
175
1
When I am trying to load the crystal report in the windows form, the below exception occurs
 
 
 
I have used the below code:
 
private void generateCrystalReport(long billNo)
{
string connStr = bll.getConnectionString();
SqlConnection sq = new SqlConnection(@connStr);
ReportDocument rprt = new ReportDocument();
rprt.Load(@"D:\DE\addArticle\addArticle\InvoiceCrystalReport.rpt");
SqlCommand cmd = new SqlCommand("InvoiceDetails", sq);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@BillNo", SqlDbType.BigInt).Value = billNo;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds, "InvoiceDetails");
rprt.SetDataSource(ds);
frm.crystalReportViewer1.ReportSource = rprt;

Answers (3)