示例#1
0
        protected void downloadDoc_Click(object sender, EventArgs e)
        {
            try
            {
                AllLoansFunction a = new AllLoansFunction();

                iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 25, 10, 25, 10);
                PdfWriter pdfWriter             = PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
                a.LoansString(cid, "2", pdfDoc);

                pdfWriter.CloseStream = false;
                pdfDoc.Close();
                Response.Buffer      = true;
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", "attachment;filename=Loans Report.pdf");
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.Write(pdfDoc);
                Response.End();
            }
            catch (Exception ex)
            { Response.Write(ex.Message); }
        }
示例#2
0
        protected void Step2_Click(object sender, EventArgs e)
        {
            if (mp == "1app")
            {
                WantUpload.Visible = true;
            }
            else
            {
                if (mp == "2napp")
                {
                    Session["Value"] = uid + "@Client";
                    Response.Redirect("~/LoansFolder/Loans2Form.aspx");
                }
                else
                {
                    try
                    {
                        AllLoansFunction a = new AllLoansFunction();

                        iTextSharp.text.Document pdfDoc = new iTextSharp.text.Document(PageSize.A4, 25, 10, 25, 10);

                        PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
                        a.LoansString(uid, "2", pdfDoc);

                        pdfWriter.CloseStream = false;
                        pdfDoc.Close();
                        Response.Buffer      = true;
                        Response.ContentType = "application/pdf";
                        Response.AddHeader("content-disposition", "attachment;filename=Loans Report.pdf");
                        Response.Cache.SetCacheability(HttpCacheability.NoCache);
                        Response.Write(pdfDoc);
                        Response.End();
                    }
                    catch (Exception ex)
                    { Response.Write(ex.Message); }
                }
            }
        }