我有这个名为StampaSingola的功能:
Private Sub StampaSingola()
Dim rpt As New rptLettera
CType(rpt.DataSource, SqlDBDataSource).SQL = "Select * from vwLettere WHERE IdLettera IN (" & Request.QueryString("IdLettera") & ")"
rpt.Run(False)
If Not rpt Is Nothing Then
Dim exp As New PdfExport
' Create a new memory stream that will hold the pdf output
Dim memStream As New System.IO.MemoryStream
' Export the report to PDF:
exp.Export(rpt.Document, memStream)
exp.Dispose()
exp = Nothing
With Me.Context.Response
.Buffer = True
.ContentType = "application/pdf"
.AddHeader("content-disposition", "attachment; filename=Archilet_Lettera_" & Request.QueryString("IdLettera") & ".pdf;")
.BinaryWrite(memStream.ToArray)
.Flush()
.End()
End With
rpt.Document.Dispose()
rpt.Dispose()
rpt = Nothing
End If
End Sub
如何在新的浏览器标签中打开pdf? 谢谢
答案 0 :(得分:1)
protected void btnDownload_Click(object sender,EventArgs e) { Response.Write(string.Format(" window.open(' {0}',' _blank');"," download.aspx& #34)); }