Web Development

General discussion


CrystalReports 8.5 Exporting

By bmartin ·
I am trying to use MS Access VBA to connect to a Crystal Report and export it to an Exchange Public Folder. I can get the report and if I let the export procedure prompt me, every thing works. Its like my ExportOptions for my report are not working. Here is a my Code:

Global myCRApp As New CRAXDRT.Application
Global myCRReport As CRAXDRT.Report
Global myCRExportOpt As CRAXDRT.ExportOptions

Sub MyExport()
Set myCRApp = New CRAXDRT.Application
Set myCRReport = myCRApp.OpenReport("c:\test.rpt", 1)
Set myCRExportOpt = myCRReport.ExportOptions

myCRExportOpt.DestinationType = crEDTMicrosoftExchange
myCRExportOpt.ExchangeDestinationType = crExhangeFolderType
myCRExportOpt.ExchangeFolderPath = "Public Folders@All public Folders@Reports"
myCRExportOpt.ExchangeProfile = myProfile
myCRExportOpt.ExchangePassword = myPassword
myCRExportOpt.FormatType = crEFTPortableDocFormat
myCRExportOpt.DiskFileName = "myTest.pdf"
myCRReport.Export False

End Sub

When I run this, I see the box that indicates records are being proccesed. When this box closes I get an error -2147190889. If I change my Export line from false to true, I am prompted and everything works just fine. Can anyone spot what I am missing?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums