Open unreg opened 8 years ago
I am getting the same error: Looking at the source code, XLSX doesnt exist.
var Writer = { CSV: CSVWriter, TSV: TSVWriter };
:) There are many on github who saves your time, this one wasted instead...
I wish I'd read this first! Please remove this project or state it is a work in progress!
So XLSX does not exist? Too bad.
I have this error too !
Same trouble.
Yeah. I wouldn't say it's a waste of time... if I hadn't wasted my time. It's really a great library, but I just needed to read xls/xlsx files, and it's the only thing it doesn't.
Same error.Is there anyone that get a great solution to edit xls/xlsx online?
Edit it as follows
// write an XLSX file
var xlsxWriter = new SimpleExcel.Writer.CSV();
var xlsxSheet = new SimpleExcel.Sheet();
var Cell = SimpleExcel.Cell;
xlsxSheet.setRecords([
[new Cell('ID', 'TEXT'), new Cell('Nama', 'TEXT'), new Cell('Kode Wilayah', 'TEXT')],
[new Cell(1, 'NUMBER'), new Cell('Kab. Bogor', 'TEXT'), new Cell(1, 'NUMBER')],
[new Cell(2, 'NUMBER'), new Cell('Kab. Cianjur', 'TEXT'), new Cell(1, 'NUMBER')],
[new Cell(3, 'NUMBER'), new Cell('Kab. Sukabumi', 'TEXT'), new Cell(1, 'NUMBER')],
[new Cell(4, 'NUMBER'), new Cell('Kab. Tasikmalaya', 'TEXT'), new Cell(2, 'NUMBER')]
]);
xlsxWriter.insertSheet(xlsxSheet);
xlsxWriter.saveFile()
Edit it as follows
// write an XLSX file var xlsxWriter = new SimpleExcel.Writer.CSV(); var xlsxSheet = new SimpleExcel.Sheet(); var Cell = SimpleExcel.Cell; xlsxSheet.setRecords([ [new Cell('ID', 'TEXT'), new Cell('Nama', 'TEXT'), new Cell('Kode Wilayah', 'TEXT')], [new Cell(1, 'NUMBER'), new Cell('Kab. Bogor', 'TEXT'), new Cell(1, 'NUMBER')], [new Cell(2, 'NUMBER'), new Cell('Kab. Cianjur', 'TEXT'), new Cell(1, 'NUMBER')], [new Cell(3, 'NUMBER'), new Cell('Kab. Sukabumi', 'TEXT'), new Cell(1, 'NUMBER')], [new Cell(4, 'NUMBER'), new Cell('Kab. Tasikmalaya', 'TEXT'), new Cell(2, 'NUMBER')] ]); xlsxWriter.insertSheet(xlsxSheet); xlsxWriter.saveFile()
This one working. but saving file is awkward. a file is saving named as "download" with no extension of it LOL 👯♂
If use example from main page get error: