Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

How to solve crystal report "Load report failed." error after installer installed of wpf application?

Our wpf application run but error is giving when i generate crystal and export to pdf.

When run application through c# .net project so, crystal report has generated but when i generate crystal report through exe or installer wpf application so, that's given an error "Load report failed.".

How can we resolve this my crystal report generated code is:-

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");
ReportDocument InvoiceReportDocument = new ReportDocument();
//InvoiceReportDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "\\" + @"\\InvoiceReport.rpt");
InvoiceReportDocument.Load("../../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);
}

This code is running in only development mode,
its not running in client machine or after installer installed.

please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer
Posted
Updated 26-May-15 20:08pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900