Link to home
Start Free TrialLog in
Avatar of pmartin73
pmartin73

asked on

VB/Crystal Reports 9/CSV Export

Using the Crystal automation objects (CRAXDRT), I'm trying to export a detail-only [headers and footers suppressed] report created in Crystal 9. The desired file format is character-separated value with a comma as the field delimiter and nothing as the string delimiter. When I attempt this using the following code, a comma is used for both the field and string delimiter, resulting in 3 commas between each field (,Field1,,,Field2,,,Field3,)

        Set oExport = MyReport.ExportOptions
        oExport.Reset
        oExport.FormatType = crEFTCommaSeparatedValues
        oExport.CharFieldDelimiter = ","
        oExport.CharStringDelimiter = ""
        oExport.DestinationType = crEDTDiskFile
        oExport.DiskFilename = "C:\MyFile.txt"
        MyReport.Export False

The report exports fine from the IDE.

Thanks,
Patrick Martin
Avatar of Dabas
Dabas
Flag of Australia image

What happens if you set oExport.CharStringDelimiter to " " (one space)???

Dabas
Avatar of aeklund
aeklund

Try this:
  oExport.CharStringDelimiter = Chr(34)
Avatar of Mike McCracken
oExport.CharStringDelimiter = """"

mlmcc
I guess we all have the same idea going here.
pmartin73:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
ASKER CERTIFIED SOLUTION
Avatar of pmartin73
pmartin73

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
pmartin73:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
If you want to get a refund for this question, post a zero-point question in https://www.experts-exchange.com/Community_Support/

Subject: Moderator Please Refund Points
Body: Please PAQ/Refund this question:
https://www.experts-exchange.com/questions/20541645/VB-Crystal-Reports-9-CSV-Export.html
Reason: I answered the question myself
pmartin73, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer