Click here to Skip to main content
15,861,125 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to make crystal report in windows application from multiple tables in mysql database but when i use this no any data shown on my report how i can troubleshoot this? Somebody help me Please....

This is my Code
C#
//adapter to use sql commands...
               MySqlDataAdapter adapter1 = new MySqlDataAdapter("Select Addmission_No,Date,Month,Student_Name,Class,Section,Roll_NO,Address,Fathers_Name,Development_Fee,Transport_Fee,Tutition_Fee,Hostal_Fee,Others,Misc,Examination_Fee,SchooBasedActivity, ScienceLabCharge, ComputerLabCharge,Total From Demand_Bill where Addmission_No='" + AdmNo + "'AND Month='" + month + "'", Connection.Connect_Main());
               MySqlDataAdapter adapter2 = new MySqlDataAdapter("Select ID,School_Name,Established_Date,Address,Contact from Account_Details", Connection.Connect_Main());
               MySqlDataAdapter adapter3 = new MySqlDataAdapter("Select Coalesce(Dues_Amount-Paid_Amount)as Total_Amount from Student_Account where Addmission_No='" + AdmNo + "'", Connection.Connect_Main());
               //DataSet for Crystal report and fill data to datatable..
               Demandbill smdata = new Demandbill();
               adapter1.Fill(smdata, "Demand_Bill");
               adapter2.Fill(smdata, "Account_Details");
               adapter3.Fill(smdata, "Student_Account");
               //call the .rpt file and set the datasource and display it
               DemandReport demrep = new DemandReport();
               demrep.SetDataSource(smdata);
               crystalReportViewer1.ReportSource = demrep;
Posted
Updated 26-May-13 19:16pm
v3
Comments
Basmeh Awad 25-May-13 8:45am    
what code have you written??
where did you got stuck??
where is the error??
how will people here know whats the problem without knowing what code are you writing
Binit_Bihari 27-May-13 1:02am    
Sorry for this..
Now this is my code..
There is no any error shown..
But the result is Zero no any thing display over the report.

//adapter to use sql commands...
MySqlDataAdapter adapter1 = new MySqlDataAdapter("Select Addmission_No,Date,Month,Student_Name,Class,Section,Roll_NO,Address,Fathers_Name,Development_Fee,Transport_Fee,Tutition_Fee,Hostal_Fee,Others,Misc,Examination_Fee,SchooBasedActivity, ScienceLabCharge, ComputerLabCharge,Total From Demand_Bill where Addmission_No='" + AdmNo + "'AND Month='" + month + "'", Connection.Connect_Main());
MySqlDataAdapter adapter2 = new MySqlDataAdapter("Select ID,School_Name,Established_Date,Address,Contact from Account_Details", Connection.Connect_Main());
MySqlDataAdapter adapter3 = new MySqlDataAdapter("Select Coalesce(Dues_Amount-Paid_Amount)as Total_Amount from Student_Account where Addmission_No='" + AdmNo + "'", Connection.Connect_Main());
//DataSet for Crystal report and fill data to datatable..
Demandbill smdata = new Demandbill();
adapter1.Fill(smdata, "Demand_Bill");
adapter2.Fill(smdata, "Account_Details");
adapter3.Fill(smdata, "Student_Account");
//call the .rpt file and set the datasource and display it
DemandReport demrep = new DemandReport();
demrep.SetDataSource(smdata);
crystalReportViewer1.ReportSource = demrep;
Basmeh Awad 27-May-13 3:46am    
does your select query producing result in sqlserver??
Binit_Bihari 27-May-13 4:04am    
Yes it's working fine.
I'm using workbench.
It's arising problem with multiple tables only.
Prasad Khandekar 25-May-13 9:03am    
Please verify the SQL's you have written in your report. You can use MySQL Workbench for this.

Regards,

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