1
你好我已經上傳的數據轉換成PDF使用下面的代碼類似保存PDF文件使用默認名稱在導出PDF
我的頁面:empdata.aspx
代碼:
Fname = "1.pdf"
crDiskFileDestinationOptions = New DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.Export()
With Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/pdf name=1.pdf"
.AddHeader("content-disposition", "inline; filename=1.pdf")
.WriteFile(Fname)
.Flush()
.Close()
End With
但是當我嘗試保存我的文件時,默認情況下它會顯示我的頁面名稱(empdata)。但是我想要默認顯示1.pdf。
這裏有什麼問題嗎?
非常感謝你......對我也有效:) – jestges 2012-02-24 11:07:47