Click here to Skip to main content
13,049,814 members (74,866 online)
Rate this:
Please Sign up or sign in to vote.
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.

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.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;
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;
            callmethod(p,d, txt_beg_h.Text, txt_to_h.Text, txt_beg_m.Text, txt_to_m.Text, cmb_Report.SelectedIndex);   
Posted 1-Dec-12 2:21am
Updated 1-Dec-12 2:28am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100