fnFooterCallback & Exporting

fnFooterCallback & Exporting

dobulet302dobulet302 Posts: 38Questions: 0Answers: 0
edited December 2010 in TableTools
I am having a problem with the footercallback function and exporting to CSV or Excel.

My excel problem is that my "$" symbol is being exported in the footer, I don't want any symbol to be exported.

My CSV problem is that any number in my footer with a comma is being pushed to a new cell. Here is my code listed below for my fnFooterCallBack.

[code]

function isWholeNumber(inputStr)
{
str = inputStr.toString();
for(var i=0; i < str.length; i++)
{
var curValue = str.charAt(i);
if(curValue < "0" || curValue > "9")
{
return false;
}
}
return true;
}

function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}

"fnFooterCallback": function (nRow, aasData, iStart, iEnd, aiDisplay ) {

var columnas=[1, 2, 3, 4, 5, 6]; //the columns you wish to add
for(var j in columnas) {
var columnaActual= columnas[j];
var total=0;
for(var i=iStart;i
This discussion has been closed.