private void sbChiTietBaoCao_Click(object sender, EventArgs e)
        {
            BaoCaoNhapHang bc = new BaoCaoNhapHang();

            DataTable dt = gcChiTietBaoCao.DataSource as DataTable;
            if (dt != null && dt.Rows.Count > 0)
            {
                bc.ChiTietBaoCao = gcChiTietBaoCao.DataSource as DataTable;
                bc.ThoiGian = ((DateTime)deThoiGian.EditValue).ToString("MM/dd/yyyy");
                XRBaoCaoNhapHang BCTonKho = new XRBaoCaoNhapHang(bc);
                try
                {
                    BCTonKho.CreateDocument();
                }
                catch (Exception ex)
                {

                }
                ReportPrintTool printTool = new ReportPrintTool(BCTonKho);
                printTool.ShowPreviewDialog();
            }
            else
            {
                MessageBox.Show("Danh Sách Báo Cáo Trống",
                   "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            }
        }
        public XRBaoCaoNhapHang(BaoCaoNhapHang bc)
        {
            InitializeComponent();
            xlNgayLap.Text = bc.ThoiGian;
            xlNhanVien.Text = StaticVariables.nhanVien.TenNhanVien;
            if (bc.ChiTietBaoCao != null)
            {
                int cellsInRow = 7;
                int rowsCount = bc.ChiTietBaoCao.Rows.Count;
                //do cao cua mot o trong table
                float rowHeight = 20f;
                for (int i = 0; i < rowsCount; i++)
                {
                    XRTableRow row = new XRTableRow();
                    row.HeightF = rowHeight;
                    for (int j = 0; j < cellsInRow; j++)
                    {
                        XRTableCell cell = new XRTableCell();
                        if (j == 0)
                        {
                            //them so thu tu
                            cell.Text = i.ToString();
                        }
                        else
                            cell.Text = bc.ChiTietBaoCao.Rows[i].ItemArray[j - 1].ToString();

                        //chinh lai kich thuoc cua moi o
                        switch (j)
                        {
                            case 0:
                                cell.WidthF = 30;
                                break;
                            case 1:
                                cell.WidthF = 110;
                                break;
                            case 2:
                                cell.WidthF = 115;
                                break;
                            case 3:
                                cell.WidthF = 200;
                                break;
                            case 4:
                                cell.WidthF = 190;
                                break;
                            case 5:
                                cell.WidthF = 60;
                                break;
                            case 6:
                                cell.WidthF = 90;
                                cell.Text = ((DateTime)bc.ChiTietBaoCao.Rows[i].ItemArray[j - 1]).ToString("MM/dd/yyyy");
                                break;
                        }
                        row.Cells.Add(cell);
                    }
                    xtDanhSachMatHang.Rows.Add(row);

                }
            }
        }
 private void deThang_TextChanged(object sender, EventArgs e)
 {
     gcChiTietBaoCao.DataSource = null;
     gvChiTietBaoCao.Columns.Clear();
     BaoCaoNhapHang bc = new BaoCaoNhapHang();
     bc.ThoiGian = ((DateTime)deThoiGian.EditValue).ToString("MM/dd/yyyy");
     gcChiTietBaoCao.DataSource = _BaoCaoNhapHangBUS.LayChiTietBaoCao(bc);
 }
        public ucBaoCaoNhapHang()
        {
            InitializeComponent();
            _BaoCaoNhapHangBUS = new BaoCaoNhapHangBUS();

            deThoiGian.DateTime = DateTime.Now;
            gcChiTietBaoCao.DataSource = null;
            gvChiTietBaoCao.Columns.Clear();
            BaoCaoNhapHang bc = new BaoCaoNhapHang();
            bc.ThoiGian = ((DateTime)deThoiGian.EditValue).ToString("MM/dd/yyyy");
            gcChiTietBaoCao.DataSource = _BaoCaoNhapHangBUS.LayChiTietBaoCao(bc);
        }
        public DataTable LayChiTietBaoCao(BaoCaoNhapHang bc)
        {
            try
            {
                SqlParameter[] para = new SqlParameter[1];
                para[0] = new SqlParameter("@p_ThoiGian", bc.ThoiGian);

                return this.LoadDataTable("CHITIETBAOCAONHAPHANG_List", para);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Message= {1}", ex.Message);
            }
            return null;
        }
 public DataTable LayChiTietBaoCao(BaoCaoNhapHang bc)
 {
     return _BaoCaoNhapHangDAL.LayChiTietBaoCao(bc);
 }