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

            rpt.Site = this.Site;
            return(rpt);
        }
Пример #2
0
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cls.ClsConnect();
                int      thamso = 4;
                string[] bien   = new string[thamso];
                object[] giatri = new object[thamso];
                bien[0]   = "@MaPos";
                giatri[0] = bll.Left(CboPos.SelectedValue.ToString().Trim(), 6);
                bien[1]   = "@Ngay";
                giatri[1] = dtpNgay.SelectedDate.Value.ToString("dd/MM/yyyy");
                if (giatri[1] == null)
                {
                    MessageBox.Show("Chưa chọn ngày : ", "Mess");
                    return;
                }
                bien[2] = "@Mau";
                if (Ration1.IsChecked == true)
                {
                    giatri[2] = "1";
                }
                else if (Ration2.IsChecked == true)
                {
                    giatri[2] = "2";
                }
                else
                {
                    giatri[2] = "3";
                }

                bien[3] = "@Nguon";
                if (Ration4.IsChecked == true)
                {
                    giatri[3] = "1";
                }
                else if (Ration5.IsChecked == true)
                {
                    giatri[3] = "2";
                }
                else
                {
                    giatri[3] = "3";
                }

                //dt = cls.LoadDataProcPara("usp_PhanTichSL", bien, giatri, thamso);
                dt = cls.LoadLdbf("usp_PhanTichSL", bien, giatri, thamso);
                //dataGrid1.ItemsSource = dt.DefaultView;
                rpt_PhanTichSL rpt = new rpt_PhanTichSL();
                RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer());
                cls.DongKetNoi();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }