public frmBaoCaorpt(Entities.BCThue[] bc, string mathue, int giatrithue, DateTime tu, DateTime den, string path, string hanhDong) { try { InitializeComponent(); CongTy(); GUI.Report.rptThue report = new GUI.Report.rptThue(); report.SetDataSource(bc); 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("MaThue", mathue); report.SetParameterValue("GiaTriThue", giatrithue); report.SetParameterValue("TenBaoCao", "Báo Cáo Thuế"); report.SetParameterValue("NgayTao", new Common.Utilities().XuLy(2, DateServer.Date().ToShortDateString())); report.SetParameterValue("MaNhanVien", Common.Utilities.User.TenNhanVien); report.SetParameterValue("Email", CT.Email); 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); } } catch { } }
public frmBaoCaorpt(Entities.BCThue[] bc, string mathue, int giatrithue, DateTime tu, DateTime den) { try { InitializeComponent(); CongTy(); GUI.Report.rptThue report = new GUI.Report.rptThue(); report.SetDataSource(bc); 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("MaThue", mathue); report.SetParameterValue("GiaTriThue", giatrithue); report.SetParameterValue("TenBaoCao", "Báo Cáo Thuế"); report.SetParameterValue("Tu", new Common.Utilities().XuLy(2, tu.ToShortDateString())); report.SetParameterValue("Den", new Common.Utilities().XuLy(2, den.ToShortDateString())); report.SetParameterValue("NgayTao", new Common.Utilities().XuLy(2, DateServer.Date().ToShortDateString())); report.SetParameterValue("MaNhanVien", Common.Utilities.User.TenNhanVien); report.SetParameterValue("Email", CT.Email); crvReport.Show(); } catch { } }