Problem with loading report

  • Thread starter Thread starter Jo
  • Start date Start date
J

Jo

Here is my code for loading report:


DataSet ds = new DataSet();
DataAdapter da = new FbDataAdapter("SELECT * FROM TABLE", myConnStr);

DataSet customers = new DataSet();
da.Fill(customers, "Customer");

string path = @"C:\Report2.rpt";

ReportDocument docRep = new ReportDocument();
docRep.SetDataSource(customers);
docRep.Load(path);
crystalReportViewer1.ReportSource = docRep;


I get error message: "Invalid report file path." and it breaks on
docRep.SetDataSource(customers); line.
If I comment that line the report is showed but without data, of course.

What I'm doing wrong?

Thanks!
 
ah... when fingers are faster than brain...

docRep.Load(path); comes before

docRep.SetDataSource(customers);
 
Back
Top