protected void btnInTonQuy_Click(object sender, DirectEventArgs e) { daBaoCaoSoDu dBCSD = new daBaoCaoSoDu(); crTonQuyCuoiNgay rptTonQuy = new crTonQuyCuoiNgay(); rptTonQuy.SetDataSource(dBCSD.TonQuyCuoiNgay(UIHelper.daPhien.MaDonVi, NgayThang)); daSoDuCuoiNgay dSDCK = new daSoDuCuoiNgay(); dSDCK.ThongTinBuuCuc(UIHelper.daPhien.MaDonVi); rptTonQuy.SetParameterValue(0, dSDCK.BuuCuc.DonVi); rptTonQuy.SetParameterValue(1, dSDCK.BuuCuc.BuuCuc); rptTonQuy.SetParameterValue(2, "Ngày " + NgayThang.ToString("dd/MM/yyyy")); rptTonQuy.SetParameterValue(3, 1); string _tf; _tf = UIHelper.daPhien.TenFileInBaoCao("TonQuyCuoiNgay"); rptTonQuy.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Server.MapPath("~") + _tf); string _url = UIHelper.daPhien.LayDiaChiURL(_tf); string script = "window.open('" + _url + "', '')"; this.btnInTonQuy.AddScript(script); }
protected void mnuitemInTonQuy_Click(object sender, DirectEventArgs e) { string json = e.ExtraParams["ValuesSDTM"]; if (json == "") { return; } Dictionary <string, string>[] companies = JSON.Deserialize <Dictionary <string, string>[]>(json); string _makt = ""; DateTime _ngay = DateTime.Now; foreach (Dictionary <string, string> row in companies) { try { _makt = row["MaKeToanNgay"]; _ngay = DateTime.Parse(row["Ngay"]); } catch { _makt = ""; } } if (_makt != "") { daBaoCaoSoDu dBCSD = new daBaoCaoSoDu(); crTonQuyCuoiNgay rptTonQuy = new crTonQuyCuoiNgay(); rptTonQuy.SetDataSource(dBCSD.TonQuyCuoiNgayBuuCuc(UIHelper.daPhien.MaDonVi, _ngay)); daSoDuCuoiNgay dSDCK = new daSoDuCuoiNgay(); dSDCK.ThongTinBuuCuc(UIHelper.daPhien.MaDonVi); rptTonQuy.SetParameterValue(0, dSDCK.BuuCuc.DonVi); rptTonQuy.SetParameterValue(1, dSDCK.BuuCuc.BuuCuc); rptTonQuy.SetParameterValue(2, "Ngày " + _ngay.ToString("dd/MM/yyyy")); rptTonQuy.SetParameterValue(3, 2); string _tf; _tf = UIHelper.daPhien.TenFileInBaoCao("TonQuyCuoiNgayBC"); rptTonQuy.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Server.MapPath("~") + _tf); string _url = UIHelper.daPhien.LayDiaChiURL(_tf); string script = "window.open('" + _url + "', '')"; this.btnThangTruoc.AddScript(script); } }