พิมพ์ Crytal Report จากหน้า Web


Crystal Report Viewer Printing

Imports CrystalDecisions.Shared
Imports System.IO
Imports CrystalDecisions.CrystalReports.Engine

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim TargetFileName As String

Dim FileSize As Long

Dim oRD As New ReportDocument

Dim crReportObject As ReportObject

Dim oExO As ExportOptions

Dim oExDo As New DiskFileDestinationOptions

'ชื่อไฟล์ pdf

TargetFileName = Server.MapPath("/") & "OrderControl" & Session.SessionID & ".pdf"

'เรียกไฟล์ Report "Income Statement.rpt"

oRD.Load(Server.MapPath("/") & "OrderControlIncome Statement.rpt")

'Export to PDF

oExDo.DiskFileName = TargetFileName

oExO = oRD.ExportOptions

oExO.ExportDestinationType = ExportDestinationType.DiskFile

oExO.ExportFormatType = ExportFormatType.PortableDocFormat

oExO.DestinationOptions = oExDo

oRD.Export()

oRD.Close()

' The following code writes the pdf file to the Client’s browser.

Response.ClearContent()

Response.ClearHeaders()

Response.ContentType = "application/pdf"

Response.WriteFile(TargetFileName)

Response.Flush()

Response.Close()

'delete the exported file from disk

'System.IO.File.Delete(TargetFilename)

End Sub

คำสำคัญ (Tags): #uncategorized
หมายเลขบันทึก: 6739เขียนเมื่อ 9 พฤศจิกายน 2005 20:26 น. ()แก้ไขเมื่อ 5 เมษายน 2012 13:39 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท