private void frmShowReport_Load(object sender, EventArgs e)
        {
            try
            {
                if (type == "ATM_ACQUIER")
                {
                    Rp_ATM_ACQUIER cry = new Rp_ATM_ACQUIER();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("para1", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "Swim")
                {
                    Rp_Swim cry = new Rp_Swim();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Swim", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "1")
                {
                    Rp1_1 cry = new Rp1_1();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "2")
                {
                    Rp1_2 cry = new Rp1_2();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "3")
                {
                    Rp3 cry = new Rp3();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "4")
                {
                    Rp4 cry = new Rp4();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "5")
                {
                    Rp5 cry = new Rp5();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "6")
                {
                    Rp6 cry = new Rp6();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "7")
                {
                    Rp7 cry = new Rp7();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Sothe", soThe);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "8")
                {
                    Rp8 cry = new Rp8();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "9")
                {
                    Rp9 cry = new Rp9();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "10")
                {
                    Rp10 cry = new Rp10();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("SoTK", soTK);
                    cry.SetParameterValue("Sothe", soThe);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "11")
                {
                    rpThu_Banana_TTT cry = new rpThu_Banana_TTT();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Swim", swim);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "NotSettlement")
                {
                    Rp_NotSettlement cry = new Rp_NotSettlement();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "HoldOver30days")
                {
                    Rp_30days cry = new Rp_30days();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_1")
                {
                    Rp_DC_1 cry = new Rp_DC_1();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_2")
                {
                    Rp_DC_2 cry = new Rp_DC_2();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_3")
                {
                    Rp_DC_3 cry = new Rp_DC_3();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_4")
                {
                    Rp_DC_4 cry = new Rp_DC_4();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_5")
                {
                    Rp_DC_5 cry = new Rp_DC_5();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_6")
                {
                    Rp_DC_6 cry = new Rp_DC_6();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    cry.SetParameterValue("Title2", title2);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_13")
                {
                    Rp_DC_13 cry = new Rp_DC_13();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title",title);
                    cry.SetParameterValue("Title2", title2);
                    cry.SetParameterValue("Tochuc", tochuc);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_7")
                {
                    Rp_DC_7 cry = new Rp_DC_7();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_8")
                {
                    Rp_DC_8 cry = new Rp_DC_8();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_9")
                {
                    Rp_DC_9 cry = new Rp_DC_9();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_10")
                {
                    Rp_DC_10 cry = new Rp_DC_10();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_11")
                {
                    Rp_DC_10 cry = new Rp_DC_10();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_12")
                {
                    Rp_DC_10 cry = new Rp_DC_10();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "ShowException")
                {
                    RpException cry = new RpException();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("swim", swim);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_14")
                {
                    Rp_TaiKhoan_Flexcube cry = new Rp_TaiKhoan_Flexcube();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("trnrefno", trnrefno);
                    crystalReportViewer1.ReportSource = cry;

                }
                else if (type == "PM_10")
                {
                    Rp_PayMent cry = new Rp_PayMent();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "PM_11")
                {
                    Rp_PayMent cry = new Rp_PayMent();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "PM_12")
                {
                    Rp_PayMent cry = new Rp_PayMent();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "PM_1")
                {
                    Rp_PM_1 cry = new Rp_PM_1();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "PM_2")
                {
                    Rp_PM_2 cry = new Rp_PM_2();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "PM_3")
                {
                    RP_PM_3 cry = new RP_PM_3();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "DC_15")
                {
                    Rp_DC_15 cry = new Rp_DC_15();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }
                else if (type == "BC_TTDL")
                {
                    Rp_TTDL_SUM cry = new Rp_TTDL_SUM();
                    cry.SetDataSource(dt);
                    cry.SetParameterValue("Ngayin", DateTime.Now.ToShortDateString());
                    cry.SetParameterValue("Gioin", DateTime.Now.ToLongTimeString());
                    cry.SetParameterValue("Thoigian", thoiGian);
                    cry.SetParameterValue("Title", title);
                    crystalReportViewer1.ReportSource = cry;
                }

            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     Rp10 rpt = new Rp10();
     rpt.Site = this.Site;
     return rpt;
 }