private void btnPrint_Click(object sender, EventArgs e)
        {
            DoiTac objDT;

            if (cboDoiTac.SelectedItem != null)
            {
                objDT = (DoiTac)cboDoiTac.SelectedItem.DataRow;
            }
            else
            {
                return;
            }
            if (dt.Rows.Count <= 0)
            {
                new MessageBox.MessageBoxBA().Show("Không có dữ liệu để in");
                return;
            }
            try
            {
                string FullPathReport = Application.StartupPath;
                FullPathReport += "\\Report\\Baocao_CuocGoiCuaDoiTac.rpt";
                string      TuNgay  = string.Format("{0 : HH:mm:ss dd/MM/yyyy}", dateTuNgay.Value);
                string      DenNgay = string.Format("{0 : HH:mm:ss dd/MM/yyyy}", dateDenNgay.Value);
                frmInBaoCao frm     = new frmInBaoCao(FullPathReport, dt, objDT, TuNgay, DenNgay);
                frm.ShowDialog(this);
            }
            catch
            { new MessageBox.MessageBoxBA().Show("Lỗi đọc dữ liệu In"); }
        }
Exemplo n.º 2
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     if (dt.Rows.Count <= 0)
     {
         new MessageBox.MessageBoxBA().Show("Không có dữ liệu để in");
         return;
     }
     try
     {
         string FullPathReport = Application.StartupPath;
         FullPathReport += "\\Report\\Baocao_KhachVangLai.rpt";
         string      TuNgay  = string.Format("{0 : HH:mm:ss dd/MM/yyyy}", dateTuNgay.Value);
         string      DenNgay = string.Format("{0 : HH:mm:ss dd/MM/yyyy}", dateDenNgay.Value);
         frmInBaoCao frm     = new frmInBaoCao(FullPathReport, dt, TuNgay, DenNgay);
         frm.ShowDialog();
     }
     catch
     { new MessageBox.MessageBoxBA().Show("Lỗi đọc dữ liệu In"); }
 }