Problem with loading report

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!
 
J

Jo

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

docRep.Load(path); comes before

docRep.SetDataSource(customers);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top