public frmBaoCaorpt(Entities.CTBCNhapHangTheoKho[] ctBCXH, DateTime truoc, DateTime sau, string path, string hanhDong) { InitializeComponent(); CongTy(); GUI.Report.BCNhapHangTheoKho report = new GUI.Report.BCNhapHangTheoKho(); report.SetDataSource(ctBCXH); crvReport.ReportSource = report; report.SetParameterValue("TenCongTy", CT.TenCongTy); report.SetParameterValue("DiaChiCongTy", CT.DiaChi); report.SetParameterValue("DienThoai", CT.SoDienThoai); report.SetParameterValue("FaxCongTy", CT.Fax); report.SetParameterValue("Web", CT.Website); report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Kho Hàng"); report.SetParameterValue("NgayTao", xulyNgay(DateServer.Date())); report.SetParameterValue("MaNhanVien", Common.Utilities.User.TenNhanVien); report.SetParameterValue("Email", CT.Email); report.SetParameterValue("tuNgay", xulyNgay(truoc)); report.SetParameterValue("DenNgay", xulyNgay(sau)); if (hanhDong == "Excel") { new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.Excel); } else if (hanhDong == "Word") { new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.WordForWindows); } else if (hanhDong == "PDF") { new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.PortableDocFormat); } }
public frmBaoCaorpt(Entities.CTBCNhapHangTheoKho[] ctBCXH, DateTime truoc, DateTime sau) { InitializeComponent(); CongTy(); GUI.Report.BCNhapHangTheoKho report = new GUI.Report.BCNhapHangTheoKho(); report.SetDataSource(ctBCXH); crvReport.ReportSource = report; report.SetParameterValue("TenCongTy", CT.TenCongTy); report.SetParameterValue("DiaChiCongTy", CT.DiaChi); report.SetParameterValue("DienThoai", CT.SoDienThoai); report.SetParameterValue("FaxCongTy", CT.Fax); report.SetParameterValue("Web", CT.Website); report.SetParameterValue("TenBaoCao", "Báo Cáo Nhập Hàng Theo Kho Hàng"); report.SetParameterValue("NgayTao", xulyNgay(DateServer.Date())); report.SetParameterValue("MaNhanVien", Common.Utilities.User.TenNhanVien); report.SetParameterValue("Email", CT.Email); report.SetParameterValue("tuNgay", xulyNgay(truoc)); report.SetParameterValue("DenNgay", xulyNgay(sau)); crvReport.Show(); }