I wrote program in C# winform that uses Crystal Report.
I wrote this code for it and I trace it all of them.
I understand that my data source fills correctly in code behind (via breakpoint)., but when I run program, nothing is shown in the form.
FrmReport:
public void test(string begDate, string endDate, string begHour, string endHour, string begMin, string endMin, int report_type)
{
parkResalt = srv.ReportParking(begDate, endDate, begHour, endHour, begMin, endMin, report_type);
xsdReport xsdrep = new xsdReport();
foreach (Parking_Services.ReportParkingResult rpr in parkResalt)
{
xsdrep.Tables["dtReportParking"].Rows.Add(rpr.Total_car, rpr.Total_Settlement, rpr.Shamsi_Date, rpr.rank);
}
System.Globalization.PersianCalendar Pc = new System.Globalization.PersianCalendar();
rep.SetDataSource(xsdrep);
rep.SetParameterValue("BegDate", begDate);
rep.SetParameterValue("ToDate", endDate);
rep.SetParameterValue("Date", Pc.GetYear(DateTime.Now) + "/" + Pc.GetMonth(DateTime.Now) + "/ " + Pc.GetDayOfMonth(DateTime.Now));
CrystalReportViewer rptViewer = new CrystalReportViewer();
rptViewer.DisplayStatusBar = false;
rptViewer.ReportSource = rep;
this.Show();
}
Report.cs
public void callmethod(string begDate, string endDate, string begHour, string endHour, string begMin, string endMin, int report_type)
{
this.frmrpt.test(begDate, endDate, begHour, endHour, begMin, endMin, report_type);
}
private void BtnReport_Click(object sender, EventArgs e)
{
Parking_Services.Service1 srv = new Parking_Services.Service1();
System.Globalization.PersianCalendar Pc = new System.Globalization.PersianCalendar();
string p = txt_from_date.FADatePicker.Text;
string d = txt_to_date.FADatePicker.Text;
createfrmreport();
callmethod(p,d, txt_beg_h.Text, txt_to_h.Text, txt_beg_m.Text, txt_to_m.Text, cmb_Report.SelectedIndex);
}