James, I tried it with numerical values, but it still doesn't work.
Mike, I tried passing the object from exportOptions and it's still not working. I think your example uses a different version of Crystal Reports; we're using 8.5. As mentioned before, we used the same logic in PowerShell and it works fine, so we think it should work in pxplus.
PowerShell code Works:
Pxplus code Fails:
Mike, I tried passing the object from exportOptions and it's still not working. I think your example uses a different version of Crystal Reports; we're using 8.5. As mentioned before, we used the same logic in PowerShell and it works fine, so we think it should work in pxplus.
PowerShell code Works:
Code Select
$app = New-Object -ComObject CrystalRuntime.Application
$report = $app.OpenReport("C:\temp\customers.rpt")
$report.EnableParameterPrompting = $false
$report.DisplayProgressDialog = $false
$report.DiscardSavedData() | Out-Null
$exportOpts = $report.ExportOptions
$exportOpts.DestinationType = 1
$exportOpts.FormatType = 31
$exportOpts.DiskFileName = "C:\temp\customers.pdf"
$exportOpts.PDFExportAllPages = $true
$report.Export($false)Pxplus code Fails:
Code Select
DEF OBJECT CR_APP,"CrystalRuntime.Application"
LET REPORT=CR_APP'OPENREPORT("C:\temp\customers.rpt")
LET REPORT'ENABLEPARAMETERPROMPTING=0
LET REPORT'DISPLAYPROGRESSDIALOG=0
LET DS=REPORT'DISCARDSAVEDDATA()
LET EXPORTOPTS=REPORT'EXPORTOPTIONS ! Opts Object EXPORTOPTS
LET EXPORTOPTS'DESTINATIONTYPE=1
LET EXPORTOPTS'FORMATTYPE=31 ! pdf
LET EXPORTOPTS'PDFEXPORTALLPAGES=-1
LET EXPORTOPTS'DISKFILENAME$="C:\temp\customers.pdf"
REPORT'EXPORT(0)