public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { HoaDonRP rpt = new HoaDonRP(); rpt.Site = this.Site; return(rpt); }
/// <summary> /// Tạo bảng in háo đơn bằng crystal report /// </summary> private void TaoBanInHoaDon() { crHoaDon hoadon = new crHoaDon(); DataSet ds = new DataSet(); ds.Tables.Add(bangcthd.Copy()); // ds.WriteXmlSchema("Sample.xml"); HoaDonRP rp = new HoaDonRP(); rp.SetDataSource(ds); rp.SetParameterValue("tbNgayBan", dtp_NgayBan.Value.ToString("dd-MM-yyyy")); rp.SetParameterValue("tbMaHD", tb_MaHD.Text); crHoaDon cr = new crHoaDon(); cr.cr_HoaDon.ReportSource = rp; cr.Show(); }
/// <summary> /// Tạo lại bản in của hóa đơn /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_InLai_Click(object sender, EventArgs e) { crHoaDon hoadon = new crHoaDon(); DataSet ds = new DataSet(); ds.Tables.Add(bang.Copy()); //ds.WriteXmlSchema("Sample.xml"); HoaDonRP rp = new HoaDonRP(); rp.SetDataSource(ds); rp.SetParameterValue("tbNgayBan", dtp_NgayBan.Value.ToString("dd-MM-yyyy")); rp.SetParameterValue("tbMaHD", lb_MaHD.Text); crHoaDon cr = new crHoaDon(); cr.cr_HoaDon.ReportSource = rp; cr.Show(); }