loCRApp = CREATEOBJECT("Crystal.CRPE.Application")
* Call crystal reports to create the Agency report
loCrReport = loCRApp.OpenReport("C:\Work\AgLeads3.Rpt")
loCrDatabase = loCrReport.Database()
loCrExportOptions = loCrReport.ExportOptions()
* Set the Crystal Report options
loCrExportOptions.DestinationType = 1
loCrExportOptions.FormatType = 4
loCrExportOptions.DiskFileName = "Agent.RTF"
loCrReport.DiscardSavedData()
loCrReport.ParameterPromptingEnabled = .F.
* Create the RTF file
loCrReport.Export(.F.)
* Reset the CR Options
loCrExportOptions.Reset()