I use SaveCSV form table data to excel (txt) csv file.
I have 2 fields cNumber: (for example)
1. Barcode (with value - 8693161008118)
2. CAVT-Number (with value - 4026203334236)
Everything is OK with SaveCSV , but when I open CSV file in excel (2007 Version I have) two cNumber fields have value like this:
1. 8.69316E+12
2. 4.0262E+12
I want to create CSV with original data from my database.sl3.
How to fix this?
There are only two ways for field type cNumber and cString.
Everything is OK with SaveCSV , but when I open CSV file in excel (2007 Version I have) two cNumber fields have value like this:
1. 8.69316E+12
2. 4.0262E+12
That looks correct for numeric data imported via a CSV as Excel applies the "General" format to that data. If you double click the cell to edit it in place you will probably see the number as you expected to see it. You will have to apply an appropriate cell "Number" format to display it as you want.
Yes Erel, when I click on cell in excel, the value is original in Excel (fx) Bar - (same bar like address bar in browsers), but in cell, the value is still the same.
Agraham, As I understand I must use Number Format, no cNumber. It be like:
Table1.AddRow(Format(dr.GetValue(1), ""), dr.GetValue(2)) ...
Here is the line where I add data in table before save CSV.
It depends how you want to open the CSV. If you are double clicking it in Windows Explorer then probably not - but if you are manually opening it in Excel with File->Open then you could record or write a VBA macro to open the CSV then format the cells and run that macro to open the file.