Ankit Agarwal

Ankit Agarwal

  • NA
  • 379
  • 253.5k

How can we solve crystal report "Load Report Failed Error"?

May 28 2015 2:47 AM
Hello,

How can we solve crystal report "Load Report Failed Error" in wpf application?

It is running only development mode but when we installed software and then generate crystal report so it is giving error "Load Report Failed".

I am using this code for generate Crystal Report:-

public void GenerateInvoice()
{
SqlConnectionClass conString = new SqlConnectionClass();
SqlCommand cmd = new SqlCommand("procGeneratePDF", conString.GetConnection());
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@InvoiceNumber", SqlDbType.Int).Value = InvoiceNum;
DataSet ds = new DataSet();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(ds,"InvoiceRecord");
InvoiceReportDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "../../InvoiceReport.rpt");
InvoiceRep.SetDataSource(ds);
InvoiceRep.SetParameterValue("CustomerName", cmbCustomer.Text);
InvoiceRep.SetParameterValue("CustomerAddress", txtCustomerAdd.Text);
InvoiceRep.SetParameterValue("CustCIty", txtCity.Text);
InvoiceRep.SetParameterValue("CustState", txtState.Text);
InvoiceRep.SetParameterValue("CustPIN", txtPin.Text);
InvoiceRep.SetParameterValue("CustCountry", txtCountry.Text);
InvoiceRep.SetParameterValue("CustInvoiceNumber", txtInvoiceNumber.Text);
InvoiceRep.SetParameterValue("ProjPORef", txtPORef.Text);
InvoiceRep.SetParameterValue("CustVendorCode", txtVendorCode.Text);
InvoiceRep.SetParameterValue("AmountInWord", txtAmountInWords.Text);

}
 
private void btnSave_Click(object sender, RoutedEventArgs e)         { GenerateInvoice(); }
please help me.

Thanks in Advance.
Ankit Agarwal
Software Engineer 

Answers (1)