Esempio n. 1
0
    protected void btnXuatPDF_Click(object sender, EventArgs e)
    {
        Func <PDFmethod> thongTin = new Func <PDFmethod>
                                    (
            () =>
        {
            PDFmethod pD = new PDFmethod();
            pD.tuNgay    = txtNgay.Value;
            pD.denNgay   = txtDenNgay.Value;
            string value = slNhomQLKH.Value.Trim();
            if (value == "0")
            {
                pD.nhomQL = "";
            }
            else
            {
                pD.nhomQL = slNhomQLKH.Items[slNhomQLKH.SelectedIndex].Text;
            }
            return(pD);
        }
                                    );

        string    table  = dvdsDonHang.InnerHtml;
        PDFmethod duLieu = thongTin();
        string    print  = duLieu.Print(table);

        Response.Write(print);
    }
Esempio n. 2
0
 protected void btnXuatPDF_Click(object sender, EventArgs e)
 {
     #region Table
     CapNhatDuLieu();
     string    sql   = SQLToanBo();
     DataTable table = Connect.GetTable(sql);
     string    html  = "<table border='1' style='width:100%; border-collapse:collapse;'>";
     html += HTMLThongKe(table);
     html += "</table>";
     #endregion
     PDFmethod pdf   = new PDFmethod(sTuNgay, sDenNgay, sNguoiGui, sNhomQLKH);
     string    print = pdf.Print(html);
     Response.Write(print);
 }