Exemplo n.º 1
0
 private void btn_excel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     xtraSaveFileDialog1.Filter   = @"Excel files |*.xlsx";
     xtraSaveFileDialog1.FileName = "NXB_" + DateTime.Now.ToString("dd-MM-yyyy hh-mm-ss");
     if (xtraSaveFileDialog1.ShowDialog() == DialogResult.OK)
     {
         var dt = ExecSQL.ExecQueryDataAsDataTable("SELECT manxb AS [Mã nhà xuất bản], nhaxuatban AS [Nhà xuất bản], diachi AS [Địa chỉ], sodt AS [Số ĐT], sofax AS [Số Fax], ghichu AS [Ghi chú] FROM dbo.tbl_nhaxuatban ORDER BY nhaxuatban");
         ComicPro.ExportExcelFromDataTable(dt, xtraSaveFileDialog1.FileName);
     }
 }
Exemplo n.º 2
0
        private void btn_in_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ComicPro.DtReport = ExecSQL.ExecQueryDataAsDataTable("pro_ct_phieunhapxuat", new { option = 1, maphieu = txt_maphieu.Text });
            if (ComicPro.DtReport.Rows.Count == 0)
            {
                Form1.Default.ShowMessageWarning("Không tìm thấy dữ liệu.");
                return;
            }
            ComicPro.Report = 3;
            FrmReport f = new FrmReport();

            f.Show();
        }