Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export a Crystal Report to a different format without prompt

COM and Automation

Export a Crystal Report to a different format without prompt

by  Mike Gagnon  Posted    (Edited  )
oCRYSTAL = CREATEOBJECT('CrystalRuntime.Application')
oReport = oCRYSTAL.OpenReport('C:\employee.RPT')
oExport = oReport.ExportOptions()
oExport.DestinationType = 1 && To file
oExport.FormatType = 27 && Excel format
oExport.DiskFileName = "C:\employee.XLS" && Name of the file
oReport.Export(.F.) && Export without prompting

For the FormatType :
[ul][li]oExport.FormatType = 1 && Crystal Report[/li]
[li]oExport.FormatType = 2 && Data Interchange[/li]
[li]oExport.FormatType = 3 && Record Style[/li]
[li]oExport.FormatType = 5 && Comma seperated values [/li]
[li]oExport.FormatType = 6 && Tab seperated values[/li]
[li]oExport.FormatType = 7 && Character seperated values [/li]
[li]oExport.FormatType = 8 && Text[/li]
[li]oExport.FormatType = 9 && Tab seperated text [/li]
[li]oExport.FormatType = 10 && Paginated Text[/li]
[li]oExport.FormatType = 11 && Lotus 123WKS [/li]
[li]oExport.FormatType = 12 && Lotus 123WK1[/li]
[li]oExport.FormatType = 13 && Lotus 123WK3 [/li]
[li]oExport.FormatType = 14 && Word for Windows[/li]
[li]oExport.FormatType = 21 && Excel 5.0[/li]
[li]oExport.FormatType = 22 && Excel 5.0 tabular[/li]
[li]oExport.FormatType = 23 && ODBC[/li]
[li]oExport.FormatType = 24 && HTML32 standard[/li]
[li]oExport.FormatType = 25 && Explorer32 Extend[/li]
[li]oExport.FormatType = 27 && Excel 7.0[/li]
[li]oExport.FormatType = 28 && Excel 7.0 tabular[/li]
[li]oExport.FormatType = 29 && Excel 8.0[/li]
[li]oExport.FormatType = 30 && Excel 8.0 tabluar[/li]
[li]oExport.FormatType = 31 && Portable Document format (PDF)[/li]
[li]oExport.FormatType = 32 && HTML40[/li]
[li]oExport.FormatType = 33 && Crystal Report 7.0[/li]
[li]oExport.FormatType = 34 && Report definition [/li]
[li]oExport.FormatType = 35 && Exact Rich Text[/li]
[li]oExport.FormatType = 36 && XML [/li][/ul]
Mike Gagnon


Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top