public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     crtHOADON_KHAM rpt = new crtHOADON_KHAM();
     rpt.Site = this.Site;
     return rpt;
 }
예제 #2
0
        private void frmBAOCAO_Load(object sender, EventArgs e)
        {
            if (type == 1)
            {
                crtPHIEUKHAMBENH pkb = new crtPHIEUKHAMBENH();
                pkb.SetDataSource(dt);
                crtBaoCao.ReportSource = pkb;
                crtBaoCao.Refresh();
            }
            if (type == 2)
            {
                crtPHIEUNHAPVIEN pnv = new crtPHIEUNHAPVIEN();
                pnv.SetDataSource(dt);
                crtBaoCao.ReportSource = pnv;
                crtBaoCao.Refresh();
            }
            if (type == 3)
            {
                crtTHONGKEBENHNHAN tkb = new crtTHONGKEBENHNHAN();
                tkb.SetDataSource(dt);
                ParameterDiscreteValue tungay = new ParameterDiscreteValue();
                tungay.Value = thamso1;
                ParameterValues pv = new ParameterValues();
                pv.Add(tungay);
                tkb.DataDefinition.ParameterFields["batdau"].ApplyCurrentValues(pv);
                ParameterDiscreteValue denngay = new ParameterDiscreteValue();
                denngay.Value = thamso2;
                ParameterValues pv1 = new ParameterValues();
                pv1.Add(denngay);
                tkb.DataDefinition.ParameterFields["ketthuc"].ApplyCurrentValues(pv1);
                crtBaoCao.ReportSource = tkb;
                crtBaoCao.Refresh();
            }
            if (type == 4)
            {
                crtTKNHANVIEN nv = new crtTKNHANVIEN();
                nv.SetDataSource(dt);
                crtBaoCao.ReportSource = nv;
                crtBaoCao.Refresh();
            }
            if (type == 5)
            {
                crtINDONTHUOC idt = new crtINDONTHUOC();
                idt.SetDataSource(dt);
                crtBaoCao.ReportSource = idt;
                crtBaoCao.Refresh();
            }
            if (type == 6)
            {
                crtCHIDINHXN cdxn = new crtCHIDINHXN();
                cdxn.SetDataSource(dt);
                crtBaoCao.ReportSource = cdxn;
                crtBaoCao.Refresh();
            }
            if (type == 7)
            {
                crtDSBenh dsbenh = new crtDSBenh();
                dsbenh.SetDataSource(dt);
                crtBaoCao.ReportSource = dsbenh;
                crtBaoCao.Refresh();
            }
            if (type == 8)
            {
                crtTKNV_CV nv_cv = new crtTKNV_CV();
                nv_cv.SetDataSource(dt);
                crtBaoCao.ReportSource = nv_cv;
                crtBaoCao.Refresh();
            }
            if (type == 9)
            {
                crtTKNV_CN nv_cn = new crtTKNV_CN();
                nv_cn.SetDataSource(dt);
                crtBaoCao.ReportSource = nv_cn;
                crtBaoCao.Refresh();
            }
            if (type == 10)
            {
                crtTKNV_Khoa nv_kh = new crtTKNV_Khoa();
                nv_kh.SetDataSource(dt);
                crtBaoCao.ReportSource = nv_kh;
                crtBaoCao.Refresh();

            }
            if (type == 11)
            {
                crtTKNV_NGVL nv_ng = new crtTKNV_NGVL();
                nv_ng.SetDataSource(dt);
                crtBaoCao.ReportSource = nv_ng;
                crtBaoCao.Refresh();

            }
            if (type == 12)
            {
                crtTKDV tkdv = new crtTKDV();
                tkdv.SetDataSource(dt);
                crtBaoCao.ReportSource = tkdv;
                crtBaoCao.Refresh();

            }
            if (type == 13)
            {
                crtTKDV_NGAY tkdv_ = new crtTKDV_NGAY();
                tkdv_.SetDataSource(dt);
                ParameterDiscreteValue tungay = new ParameterDiscreteValue();
                tungay.Value = thamso1;
                ParameterValues pv = new ParameterValues();
                pv.Add(tungay);
                tkdv_.DataDefinition.ParameterFields["ngaydau"].ApplyCurrentValues(pv);
                ParameterDiscreteValue denngay = new ParameterDiscreteValue();
                denngay.Value = thamso2;
                ParameterValues pv1 = new ParameterValues();
                pv1.Add(denngay);
                tkdv_.DataDefinition.ParameterFields["ngaysau"].ApplyCurrentValues(pv1);
                crtBaoCao.ReportSource = tkdv_;
                crtBaoCao.Refresh();

            }
            if (type == 14)
            {
                crtTKBN_Ngay tkbn_ngay = new crtTKBN_Ngay();
                tkbn_ngay.SetDataSource(dt);
                ParameterDiscreteValue tungay = new ParameterDiscreteValue();
                tungay.Value = thamso1;
                ParameterValues pv = new ParameterValues();
                pv.Add(tungay);
                tkbn_ngay.DataDefinition.ParameterFields["tungay"].ApplyCurrentValues(pv);
                ParameterDiscreteValue denngay = new ParameterDiscreteValue();
                denngay.Value = thamso2;
                ParameterValues pv1 = new ParameterValues();
                pv1.Add(denngay);
                tkbn_ngay.DataDefinition.ParameterFields["denngay"].ApplyCurrentValues(pv1);
                crtBaoCao.ReportSource = tkbn_ngay;
                crtBaoCao.Refresh();

            }
            if (type == 15)
            {
                crtTKBN_Tuvong tkbn_tuvong = new crtTKBN_Tuvong();
                tkbn_tuvong.SetDataSource(dt);
                ParameterDiscreteValue tungay = new ParameterDiscreteValue();
                tungay.Value = thamso1;
                ParameterValues pv = new ParameterValues();
                pv.Add(tungay);
                tkbn_tuvong.DataDefinition.ParameterFields["batdau"].ApplyCurrentValues(pv);
                ParameterDiscreteValue denngay = new ParameterDiscreteValue();
                denngay.Value = thamso2;
                ParameterValues pv1 = new ParameterValues();
                pv1.Add(denngay);
                tkbn_tuvong.DataDefinition.ParameterFields["ketthuc"].ApplyCurrentValues(pv1);
                crtBaoCao.ReportSource = tkbn_tuvong;
                crtBaoCao.Refresh();
            }
            if (type == 16)
            {
                crtTKBN_Nhapvien tkbn_nv = new crtTKBN_Nhapvien();
                tkbn_nv.SetDataSource(dt);
                crtBaoCao.ReportSource = tkbn_nv;
                crtBaoCao.Refresh();
            }
            if (type == 17)
            {
                crtTKBN_BHYT tkbn_bhyt = new crtTKBN_BHYT();
                tkbn_bhyt.SetDataSource(dt);
                crtBaoCao.ReportSource = tkbn_bhyt;
                crtBaoCao.Refresh();
            }
            if (type == 18)
            {
                crtBENHAN ba = new crtBENHAN();
                ba.SetDataSource(dt);
                crtBaoCao.ReportSource =ba ;
                crtBaoCao.Refresh();
            }
            if (type == 19)
            {
                crtPHIEUXUATVIEN xv = new crtPHIEUXUATVIEN();
                xv.SetDataSource(dt);
                crtBaoCao.ReportSource = xv;
                crtBaoCao.Refresh();
            }
            if (type == 20)
            {
                crtTAMUNGVP tu = new crtTAMUNGVP();
                tu.SetDataSource(dt);
                crtBaoCao.ReportSource = tu;
                crtBaoCao.Refresh();
            }
            if (type == 21)
            {
                crtPHIEUXETNGHIEM tu = new crtPHIEUXETNGHIEM();
                tu.SetDataSource(dt);
                crtBaoCao.ReportSource = tu;
                crtBaoCao.Refresh();
            }
            if (type == 22)
            {
                crtTKDV_TEN dvten = new crtTKDV_TEN();
                dvten.SetDataSource(dt);
                crtBaoCao.ReportSource = dvten;
                crtBaoCao.Refresh();
            }
            if (type == 23)
            {
                crtHOADON_KHAM pkb = new crtHOADON_KHAM();
                pkb.SetDataSource(dt);
                crtBaoCao.ReportSource = pkb;
                crtBaoCao.Refresh();
            }
            if (type == 24)
            {
                crtHOADON_THUOC pkb = new crtHOADON_THUOC();
                pkb.SetDataSource(dt);
                crtBaoCao.ReportSource = pkb;
                crtBaoCao.Refresh();
            }
            if (type == 25)
            {
                crtDOANHTHU tkdt = new crtDOANHTHU();
                tkdt.SetDataSource(dt);
                ParameterDiscreteValue tungay = new ParameterDiscreteValue();
                tungay.Value = thamso1;
                ParameterValues pv = new ParameterValues();
                pv.Add(tungay);
                tkdt.DataDefinition.ParameterFields["tungay"].ApplyCurrentValues(pv);
                ParameterDiscreteValue denngay = new ParameterDiscreteValue();
                denngay.Value = thamso2;
                ParameterValues pv1 = new ParameterValues();
                pv1.Add(denngay);
                tkdt.DataDefinition.ParameterFields["denngay"].ApplyCurrentValues(pv1);
                crtBaoCao.ReportSource = tkdt;
                crtBaoCao.Refresh();
            }
            if (type == 26)
            {
                crtSDTHUOC tksdthuoc = new crtSDTHUOC();
                tksdthuoc.SetDataSource(dt);
                ParameterDiscreteValue tungay = new ParameterDiscreteValue();
                tungay.Value = thamso1;
                ParameterValues pv = new ParameterValues();
                pv.Add(tungay);
                tksdthuoc.DataDefinition.ParameterFields["tungay"].ApplyCurrentValues(pv);
                ParameterDiscreteValue denngay = new ParameterDiscreteValue();
                denngay.Value = thamso2;
                ParameterValues pv1 = new ParameterValues();
                pv1.Add(denngay);
                tksdthuoc.DataDefinition.ParameterFields["denngay"].ApplyCurrentValues(pv1);
                crtBaoCao.ReportSource = tksdthuoc;
                crtBaoCao.Refresh();
            }
        }