Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpt_ChovayNangmuc02 rpt = new rpt_ChovayNangmuc02();

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void Lblin02kt_OnMouseDown(object sender, RoutedEventArgs e)
        {
            try
            {
                cls.ClsConnect();
                int      thamso = 3;
                string[] bien   = new string[thamso];
                object[] giatri = new object[thamso];
                bien[0] = "@Ngay";
                if (dtpNgay.SelectedDate != null)
                {
                    giatri[0] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
                    bien[1]   = "@TuNgay";
                    if (dtpTuNgay.SelectedDate != null)
                    {
                        giatri[1] = dtpTuNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
                        bien[2]   = "@DenNgay";
                        if (dtpDenNgay.SelectedDate != null)
                        {
                            giatri[2] = dtpDenNgay.SelectedDate.Value.ToString("yyyy-MM-dd");
                        }
                    }
                }

                var dt02 = cls.LoadDataProcPara("usp_ChovayNangmuc02", bien, giatri, thamso);

                rpt_ChovayNangmuc02 rpt1 = new rpt_ChovayNangmuc02();
                RPUtility.ShowRp(rpt1, dt02, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                //FileName = Thumuc + "\\" + str.Left(CboPos.SelectedValue.ToString().Trim(), 6) + "_Mẫu 02_KT " + dtpTuNgay.SelectedDate.Value.ToString("ddMMyyyy") + "_Đến ngày_" + dtpDenNgay.SelectedDate.Value.ToString("ddMMyyyy") + ".csv";
                ////str.ExportToExcel(dt02, FileName);
                //str.ExportDTToExcel(dt02, FileName);
                //MessageBox.Show("Copy Excel to : " + FileName, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information);
                //str.OpenExcel(FileName);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi : " + ex.Message, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }