Click here to Skip to main content
15,919,613 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Microsoft.Reporting.WinForms.ReportViewer' does not contain a definition for 'ReportSource' and no extension method 'ReportSource' accepting a first argument of type 'Microsoft.Reporting.WinForms.ReportViewer' could be found (are you missing a using directive or an assembly reference?

C#
private void btnreport_Click(object sender, EventArgs e)
    {
        ReportDocument crystalRpt = new ReportDocument();
        crystalRpt.Load("C:Users\\Document\\CrystalReport1.rpt");
        crystalReportViewer1.ReportSource = crystalRpt;
        crystalReportViewer1.Refresh();
    }
Posted

1 solution

can u tell me from where you are getting data for your report ?
 
Share this answer
 
Comments
jacobjohn196 5-Mar-13 4:50am    
i'm getting the data from dataset
solanki.net 5-Mar-13 5:15am    
but in your code u did not use database connection like that :
report.SetDatabaseLogon("userid", "pas", "server", "database");

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