Copied from:
http://diamond.businessobjects.com/node/1952
solution
Working with csv files
The problem for us here was that Crystal was determining the data-types of the csv files based on its
own default settings, which from testing, seems to be that it takes the first 12 rows into account. This
meant it was picking up an alpha-numeric column as a number just because the first 20 or so values in the
table didn't contain any "alphas". If you wish to override this and specify your own settings you have two options:
1) Create a file/system DSN to connect to the data and specify each column indiviually:
? a) Goto System DSN and click add, select the MS Text Driver
? b) Enter a name, turn off current directory checkbox and select directory
? c) Click options and select .csv file extension (you need to turn off the
? ? ? defaults)
? d) Click Define Format, and then guess. For each of the columns select the type
? ? ? you want. By default they all seem to be text
? e) Click okay (you may get an attribute error here but ignore.
Then use this DSN in the Crystal report.
2) Alternatively, create a "schema.ini" file yourself and place it in the same folder as the csv file. Really all a DSN does
? ? is create this file and adds it into the folder. It also adds the burden of adding another DSN on your Crystal server.
? ? By just adding the schema.ini to the folder and using an "Access/Excel (DAO)" or ODBC text connection, Crystal automatically
? ? picks it up and uses your specified settings. Our workaround was to set the MaxScanRows value of the schema to 1 so
? ? as to just use the headings in determining the data types i.e. all strings.
? [example.csv]
? ColNameHeader=False
? Format=CSVDelimited
? MaxScanRows=1
? CharacterSet=OEM
or you can manually specify the data types if you needed some as numbers, see here
http://support.microsoft.com/kb/210073.
Please post back if you have anymore problems or questions.