
Problems with crystal 8.5 and vbscript pdf export
I have a report that I would like to export to pdf using a vb script.
Everything is working to export it to a word file (however the output
is not exactly WYSIWYG). When I try and change the format type to
CREFTPORTABLEDOCFORMAT or 31, I get a message that the enum is
undefined. However, if I remove the false from Export method and
manually select the PDF export option it works correctly.
Has anyone seen this before and/or was able to fix it.
Thanks in advance for any assistance.
/Steve
PS Here is the current code that I am using
' Constant Values
Dim CREFTWORDFORWINDOWS
Dim CREFTRICHTEXT
Dim CREFTEXCEL21
Dim CREFTEXCEL70
Dim CREFTCRYSTALREPORT
Dim CREFTPORTABLEDOCFORMAT
Dim CREDTDISKFILE
Dim CREDTMAILMAPI
Dim EMFMIMETYPE
CREFTWORDFORWINDOWS = 14
CREFTRICHTEXT = 4
CREFTEXCEL21 = 18
CREFTEXCEL70 = 27
CREFTCRYSTALREPORT = 1
CREFTCRYSTALREPORT7 = 33
CREFTPORTABLEDOCFORMAT = 31
CREDTDISKFILE = 1
CREDTMAILMAPI = 2
crAllowPlaceHolders = 2
crDelayTotalPageCountCalc = 1
EMFMIMETYPe = "application/x-emf"
EPFMIMETYPE = "application/x-epf"
ETFMIMETYPE = "application/x-etf"
Set CRPE=CreateObject("Crystal.CRPE.Application")
Set Report=CRPE.OpenReport("d:\internalwww\reports\newparts.rpt")
Report.DiscardSavedData
Report.ExportOptions.DestinationType=CREDTMAILMAPI
Report.ExportOptions.DiskFileName="\\fileserver\kudu\production\inventory
control\crystal_reports\newparts.doc"
Report.ExportOptions.FormatType=31
'Report.ExportOptions.FormatType=CREFTPORTABLEDOCFORMAT
Report.ExportOptions.MailMessage="See attached"
Report.ExportOptions.MailSubject="New parts generated in the last day
as of " & Now()
Report.Export FALSE
Set report=nothing
Set CRPE=nothing