>Craig,
>
>I finally have this report looking pretty good. The whole reason I used CR to begin with was to create an RTF file that could be e-mailed. I want it to be completly automated, so the user clicks PRINT and it will run the CR report, create the RTF file, and attach it to an e-mail and send it.
>
>Do you know if it is possible to compile a CR report and have it automatically export to RTF without the print dialog displaying? Or should I start over and use automation with Word?
>
>Thanks again.
>
>Rob
>
>
Yup, you can. I use the Automation Server. Here's my code:
loCRApp = CREATEOBJECT("Crystal.CRPE.Application")
* Set the Crystal Report options
loCrExportOptions.DestinationType = 1
loCrExportOptions.FormatType = 4
loCrExportOptions.DiskFileName = laAttach[lnAttach]
loCrReport.DiscardSavedData()
* This line will supress the Print dialog in Crystal IF Crystal has
* everything it needs to handle the report.
loCrReport.ParameterPromptingEnabled = .F.
* Create the RTF file
loCrReport.Export(.F.)
* Reset the CR Options
loCrExportOptions.Reset()
* Clear the report objects
loCrReport = .NULL.
loCrDataBase = .NULL.
loExportOptions = .NULL.
After this, I call IDS Mail to send the report.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer