faisalman / simple-excel-js

SimpleExcel.js - WIP client-side script to parse / convert / write XML / CSV / TSV / HTML / JSON / etc formats.
http://faisalman.github.io/simple-excel-js/
189 stars 74 forks source link

TypeError: SimpleExcel.Writer.XLSX is not a constructor #12

Open unreg opened 7 years ago

unreg commented 7 years ago

If use example from main page get error:

TypeError: SimpleExcel.Writer.XLSX is not a constructor
aoakeson commented 7 years ago

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

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

vipullimbachiya commented 7 years ago

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

davewilton commented 7 years ago

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

zh-wowtv commented 7 years ago

So XLSX does not exist? Too bad.

marcioarp commented 7 years ago

I have this error too !

DaviAragao commented 6 years ago

Same trouble.

kaabsimas commented 6 years ago

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.

VanWade commented 6 years ago

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

sujkh85 commented 6 years ago

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()
MahbbRah commented 4 years ago

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