simple-excel-js icon indicating copy to clipboard operation
simple-excel-js copied to clipboard

TypeError: SimpleExcel.Writer.XLSX is not a constructor

Open unreg opened this issue 8 years ago • 10 comments

If use example from main page get error:

TypeError: SimpleExcel.Writer.XLSX is not a constructor

unreg avatar Oct 14 '16 07:10 unreg

I am getting the same error: Looking at the source code, XLSX doesnt exist.

var Writer = { CSV: CSVWriter, TSV: TSVWriter };

aoakeson avatar Oct 31 '16 19:10 aoakeson

:) There are many on github who saves your time, this one wasted instead...

vipullimbachiya avatar Dec 06 '16 13:12 vipullimbachiya

I wish I'd read this first! Please remove this project or state it is a work in progress!

davewilton avatar Jan 17 '17 23:01 davewilton

So XLSX does not exist? Too bad.

zh-wowtv avatar Feb 02 '17 17:02 zh-wowtv

I have this error too !

marcioarp avatar Mar 02 '17 13:03 marcioarp

Same trouble.

DaviAragao avatar Oct 31 '17 16:10 DaviAragao

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.

kaabsimas avatar Nov 10 '17 03:11 kaabsimas

Same error.Is there anyone that get a great solution to edit xls/xlsx online?

VanWade avatar Jan 12 '18 03:01 VanWade

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()

sujkh85 avatar Jan 23 '18 02:01 sujkh85

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 👯‍♂

MahbbRah avatar Dec 02 '19 13:12 MahbbRah