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

Export crystal report to csv file in vb

Status
Not open for further replies.

dgr01

IS-IT--Management
Apr 9, 2003
17
US
I am trying to automate the export of a crystal reports version 9.2.2 report to a CSV file. I tried both ExportOptions.FormatType = 7 and 5 but both give me strange results in the output file. When I export the report manually from Crystal, it prompts me for format and I select "Separated Values (CSV), then it prompts me for Destination and I select "Disk File". Then it goes to another prompt box and asks for Separated Values for which I select the defaults:
Separated Character = ,
Delimited = "
Then a new prompt box asks for “Number and Date Format Settings” and I need to check both prompts.

I am trying to automate this in a vbs and I can't find the appropriate ExportOption settings. below are the ones I found and when i run it using just those, i am getting a csv output file but it has data in each field like report title and other garbage that i don't want. Anybody have any thoughts on this?

Here are my current settings:
orpt.ExportOptions.DestinationType = 1
orpt.ExportOptions.FormatType = 5
orpt.ExportOptions.UseReportDateFormat = True
orpt.ExportOptions.UseReportNumberFormat = True

Thanks, dgr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top