Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Samuel Zallocco on Aug 29, 2009 10:16
open dhtmlx forum
dhtmlxGrid CSV file format

Hi I'm Samuel From Italy....

I've some file exported from EXCEL in CSV file format that look like this:

Codice;Descrizione;Euro;Disponibilità
S0001;"Statuetta, in argento; decorata a \"mano\", raffigurante un gattino rampante";35,45;10
C0034;"Quadro; cornice in argento; decorato a mano, soggetto angelo";55,32;2
R3209;"Bomboniera; resina, decorata a mano; soggetto; cappello laurea";12,15;234

As you can see the format used by EXCEL and other program to export as CSV is not the one you defined in your mygrid.parse(csv,"csv") function....

This format is used by EXECL when you put in a cell something like:

[S0001][Statuetta, in argento; decorata a "mano", raffigurante un gattino rampante][35,45][10]

due to the presence of the "special" characters: ,;" in the content of a cell

I've this code:
...
mygrid.enableCSVAutoID(true);
mygrid.enableCSVHeader(true);
mygrid.csv.row = "\n";
mygrid.csv.cell = ";";
mygrid.parse(csv,"csv");
...

what else I've to add to make it work with the above CSV format?
Bye and Thank You for dhtmlxGrid


Answer posted by dhxSupport on Aug 31, 2009 01:52
Your code is correct. Please check if "csv" if correct nave of the string with data in CSV format. Also nothe loading grid from CSV format is available in PRO version only.