when exporting to xls/csv
when exporting to xls/csv
tbar
Posts: 4Questions: 0Answers: 0
I'm using TableTools to export table to csv/xls without problems. I've got cells containing multiple lines separated by a
and I would like this functionality present in the exported file.
I've tried initialising with "sNewLine": "auto" and "sNewLine": "" but this doesn't give the wanted behaviour.
Is it even possible to do what I want?
and I would like this functionality present in the exported file.
I've tried initialising with "sNewLine": "auto" and "sNewLine": "" but this doesn't give the wanted behaviour.
Is it even possible to do what I want?
This discussion has been closed.
Replies
Allan
[code]
"fnCellRender": function ( sValue, iColumn, nTr, iDataIndex ) {
return '"'+sValue.replace(/
|/g,"\n")+'"';
}
[/code]
This works when opening the file with Excel 2007. Please notice that cells containing multiple values initially appears within excel as if they only contains one value. Change the view of the file to see all values.
"fnCellRender": function (sValue, iColumn, nTr, iDataindex){
var valueExport = "";
var data = $(sValue)[0];
var tag = data.tagName;
if(tag=='li'){
valueExport = data.innerHTML;
}
return valueExport;
}
},