>SET DEFAULT TO (this.cAppStartPath)
>
>* Create a temporary data file.
>lcTempFile = SYS(3) + ".dbf"
>SELECT calldata
>COPY TO (lcTempFile)
>CLOSE DATA ALL
>
>loReport = CreateObject("Crystal.CrystalReport")
>
>* Set the report object properties.
>loReport.ReportFileName = this.cAppStartPath + "calldata.rpt"
>loReport.Destination = 2 && disk file
>loReport.PrintFileName = lcOutputFile && name of output file
>loReport.PrintFileType = 15 && RTF file
>
>* Assign the temporary database to the crystal reports object.
>loReport.RetrieveDataFiles()
>loReport.DataFiles(0) = this.cAppStartPath + lcTempFile
>
>* Generate the output file.
>lnResult = loReport.PrintReport()
>
>RELEASE loReport
>
>CLOSE DATA ALL
>IF !EMPTY(lcTempFile)
> IF FILE(lcTempFile)
> DELETE FILE (lcTempFile)
> ENDIF
>ENDIF
>
>RETURN lnResult = 0
>