Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > ปัญหา itextsharp ไม่สามารถใช้ Respone.Redirect ควบคู่ได้



 

ปัญหา itextsharp ไม่สามารถใช้ Respone.Redirect ควบคู่ได้

 



Topic : 105626



โพสกระทู้ ( 34 )
บทความ ( 0 )



สถานะออฟไลน์




Code (VB.NET)
        Dim nnn As String = "ใบค่าประกันและค่ามัดจำ ห้อง"
        Dim output = New MemoryStream()
        Dim bf As BaseFont = BaseFont.CreateFont("c:\Windows\fonts\Tahoma.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED)
        Dim document As New Document(PageSize.A6, 10, 10, 14, 14)
        Dim writer As PdfWriter = PdfWriter.GetInstance(document, output)
        Dim f As New Font(bf, 8.0F, Font.NORMAL)
        ' Open the document to enable you to write to the document
        document.Open()
'======================================Variable=====================================
        Dim tt, calpriceR, caldep, caldadep As Integer
        Dim headerRoomID As New PdfPCell(New Phrase("ห้องพักหมายเลข" + " " + DropDownList1.SelectedItem.Text, f))
        headerRoomID.Colspan = 2
        Dim headerName As New PdfPCell(New Phrase((memTNLN), f))
        headerName.Colspan = 2
        Dim listPay As New PdfPCell(New Phrase("รายการ", f))
        Dim pricePay As New PdfPCell(New Phrase("จำนวนเงิน", f))
        Dim priceRoomN As New PdfPCell(New Phrase("ค่าห้องพัก", f))
        Dim priceRoomB As New PdfPCell(New Phrase((amount_room.Text), f))
        Dim mudJamN As New PdfPCell(New Phrase("ค่ามัดจำ", f))
        Dim mudJam As New PdfPCell(New Phrase((amount_mount_money0.Text), f))
        Dim guaranteeN As New PdfPCell(New Phrase("ค่าประกันความเสียหาย", f))
        Dim guarantee As New PdfPCell(New Phrase((guarantee_money.Text), f))
        Dim totalN As New PdfPCell(New Phrase("รวม", f))

        '==============Cal Total=============
        calpriceR = Convert.ToInt64(amount_room.Text)
        caldep = Convert.ToInt64(amount_mount_money0.Text)
        caldadep = Convert.ToInt64(guarantee_money.Text)
        tt = calpriceR + caldep + caldadep
        Dim total As New PdfPCell(New Phrase((tt), f))
        table.AddCell(headerRoomID)
        table.AddCell(headerName)
        table.AddCell(listPay)
        table.AddCell(pricePay)
        table.AddCell(priceRoomN)
        table.AddCell(priceRoomB)
        table.AddCell(mudJamN)
        table.AddCell(mudJam)
        table.AddCell(guaranteeN)
        table.AddCell(guarantee)
        table.AddCell(totalN)
        table.AddCell(total)
        document.Add(table)
        document.Add(New Paragraph(" " + "ลงชื่อผู้รับเงิน" + "  " + "........................................", f))

        '===================Close Pdf=================
        document.Close()
        Response.ContentType = "application/pdf"
        Response.AddHeader("Content-Disposition", String.Format("attachment;filename=Receipt-{0}.pdf", nnn))
        Response.BinaryWrite(output.ToArray())
        Response.OutputStream.Write(output.GetBuffer(), 0, output.GetBuffer().Length)
        Response.Redirect("SearchEditRent.aspx") ' ปัญหาอยู่ที่บรรทัดนี้ค่ะ 



ถ้าใส่ Response.Redirect("SearchEditRent.aspx") มันจะไม่แสดงไฟล์ PDF ค่ะ แต่จะเปลี่ยนไปที่ หน้า SearchEditRent.aspx เลย
จุดประสงค์คือ อยากให้แสดงไฟล์ PDF ก่อน แล้วค่อยเปลี่ยนไปที่หน้า SearchEditRent.aspx ค่ะ

รบกวนพี่ๆช่วยดูให้หน่อยนะค่ะ ขอบคุณค่ะ



Tag : .NET, Web (ASP.NET), VB.NET







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2014-02-09 05:27:17 By : chariyamat View : 986 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code (VB.NET)
Response.Clear()


ลอง Clear ดูก่อนแล้วค่อย Redirect ครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-02-09 08:16:47 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ปัญหา itextsharp ไม่สามารถใช้ Respone.Redirect ควบคู่ได้
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่