Click here to Skip to main content
15,908,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my code snippet
Reports.CenterReport cr = new Reports.CenterReport();
            cr.Database.Tables[0].SetDataSource(dt);
            crystalReportViewer1.ReportSource = cr;

Getting every time error that
HTML
'Project.Reports.CenterReport' does not contain a definition for 'Database' and no extension method 'Database' accepting a first argument of type 'Project.Reports.CenterReport' could be found (are you missing a using directive or an assembly reference?)

can anyone suggest which assembly i have to add?
Posted
Updated 10-Oct-12 8:10am
v2

1 solution

Try:
C#
customerReport = new ReportDocument();
string reportPath = Server.MapPath("CrystalReport.rpt");
customerReport.Load(reportPath);

customerReport.SetDataSource(dt);
 
Share this answer
 
Comments
sahabiswarup 11-Oct-12 7:55am    
it not works..can you please tell me in details what are these customerReport, reportPath?

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