1 reply
Hi Wakin,
The following code takes a filename of a Crystal Report and exports it to a PDF. It works with Crystal 8.5. I haven't tried it with anything else.
Fred.
---
function ExportRPT( line )
dim rptfile, exportfile
dim RetValue
dim strDate
dim objCRRpt
dim objCRApp
WriteLog( "ExportRPT: " & line )
strDate = year(now()) & "-" & right("0" & month(now()),2) & "-" & right("0" & day(now()),2)
RetValue = ""
rptfile = UCase(line)
exportfile = Replace(rptfile, ".RPT", "-" & strDate & ".PDF")
Set objCRApp = CreateObject("CrystalRunTime.Application")
set objCRRpt = objCRApp.openreport( rptfile )
With objCRRpt
With .exportoptions
.formattype = crEFTPortableDocFormat
.PDFExportAllPages = true
.diskfilename = exportfile
.destinationtype = CrEDTDiskFile
.UseReportDateFormat = True
.UseReportNumberFormat = True
End With
.export(False)
RetValue = exportfile
End With
ExportRPT = RetValue
end function
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending