public string VietBaoCao() { ReportDocument rd = new ReportDocument(); string path = Directory.GetCurrentDirectory() + @"\Thống kê tồn kho"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } try { rd.Load(Directory.GetCurrentDirectory() + @"\REPORT\CrystalReportThongKeTonKho.rpt"); rd.SetDataSource(DALThongKeTonKho.ThongKe(Tungay, Denngay)); path = path + @"\" + Mota + ".pdf"; rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, path); return(path); } catch { return(path = ""); } }
private void BtXemtonkho_Click(object sender, EventArgs e) { GVthongke.DataSource = DALThongKeTonKho.ThongKe(DALThongKeTonKho.layngaydau().Ngaynhap, Convert.ToDateTime(dateTimePicker2.Text)); }