在经典ASP中将水晶报告导出为PDF

时间:2010-08-20 10:06:02

标签: asp-classic

我有使用WebReportBroker对象的第三方网站,并使用CRviewer查看水晶报告。我想以PDF格式保存此报告的物理位置。帮我看看怎么做?

1 个答案:

答案 0 :(得分:1)

我不知道“WebReportBroker”,但这是我们执行Crystal Report然后将其导出为pdf的方式:

'---------------------------------------------------------
' Crystal Reports Constants
'---------------------------------------------------------
' ExportDestinationType
const crEDTNoDestination        = "0"
const crEDTDiskFile             = "1"
const crEDTEMailMAPI            = "2"
const crEDTEMailVIM             = "3"
const crEDTMicrosoftExchange    = "4"
const crEDTApplication          = "5"
const crEDTLotusDomino          = "6"

' ExportFormatType
const crEFTCrystalReport        = "1"
const crEFTCommaSeparatedValues = "5"
const crEFTWordForWindows       = "14"
const crEFTHTML32Standard       = "24"
const crEFTPortableDocFormat    = "31"
const crEFTExcel97              = "36"
const crEFTXML                  = "37"
Const crEFTExcelDataOnly        = "38"


dim oApp : set oApp = Server.CreateObject("CrystalRuntime.Application.10")
dim oRpt
dim CrystalExportOptions
dim crxdatabasetable

'1 - for processing
set oRpt = oApp.OpenReport("c:\reports\myReport.rpt", 1)

oRpt.MorePrintEngineErrorMessages = false
oRpt.EnableParameterPrompting = false

set CrystalExportOptions = oRpt.ExportOptions
CrystalExportOptions.DiskFileName = "myPDFReport.pdf"
CrystalExportOptions.FormatType = CInt(crEFTPortableDocFormat)
CrystalExportOptions.DestinationType = CInt(crEDTDiskFile)

oRpt.Export False

set oRpt = nothing
set oApp = nothing