sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

Formula doesn't work on Export2Excel

Open neridonk opened this issue 11 years ago • 1 comments

I tested the http://sheetjs.com/demos/table.html

and changed the sheet_from_array_of_arrays methode to

function sheet_from_array_of_arrays(data, opts) { var ws = {}; var range = { s: { c: 10000000, r: 10000000 }, e: { c: 0, r: 0 } }; for (var R = 0; R != data.length; ++R) { for (var C = 0; C != data[R].length; ++C) { if (range.s.r > R) range.s.r = R; if (range.s.c > C) range.s.c = C; if (range.e.r < R) range.e.r = R; if (range.e.c < C) range.e.c = C; var cell = { v: data[R][C] }; if (cell.v == null) continue; var cell_ref = XLSX.utils.encode_cell({ c: C, r: R });

  if (typeof cell.v === 'number') cell.t = 'n';
  else if (typeof cell.v === 'boolean') cell.t = 'b';
  else if (cell.v instanceof Date) {
    cell.t = 'n'; cell.z = XLSX.SSF._table[14];
    cell.v = datenum(cell.v);
  }
  else cell.t = 's';


  cell.f = 'A2+A3';


  console.log(cell);

  ws[cell_ref] = cell;
}

} if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range); return ws; }

but the -> cell.f = 'A2+A3'; didnt work

neridonk avatar Nov 10 '15 15:11 neridonk

ok worked with https://github.com/mcsf/js-xlsx/commit/d43964564d2d455271a9348f904fe2c34e5b1a59 change

ill close this...

neridonk avatar Nov 11 '15 15:11 neridonk