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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting a crystal report

Status
Not open for further replies.

selby

Programmer
Jan 18, 2001
1
ZA
Hi all,

I need help exporting a crystal report to a word document from VB6. (The Stored Proc works and the report appears properly) I just need an example of code in VB that shows me how to export the report to a file instead of a printer.
 
Use the .exportoptions command to set the destination type, the format of the file and the name of the file. THen use .export to export the file. For example, the code below says for report1 I'm going to spool a file to the disk of format type Excel named "Test.xls". Now export it and don't prompt the user. It then does it again in rich text format.

With Report1
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.FormatType = crEFTExcel80
.ExportOptions.DiskFileName = "C:/Test.xls"
.Export (False)
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.FormatType = crEFTRichText
.ExportOptions.DiskFileName = "C:/Test.doc"
.Export (False)
End With

Hope this helps.

CrystalVisualBOracle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top