mohammed zubair

mohammed zubair

  • 2.1k
  • 7
  • 525

Crystal report is not loading from the specified path

Dec 4 2017 1:42 AM
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)