As promised, I am sharing my solution to convert l...
# suitescript
b
👀 2
👍 1
b
did you try generating the workbook line by line in sheet js or did you skip to generating excel files with your own code
w
@battk is that better/faster then using utils.json_to_sheet(tableJson)?
b
@battk Yeah, but I couldn't get it to write it line by line, per the documentation for Netsuite it only shows generating the file as a whole, but if you can share code that accomplish this I would be happy to check it out
b
json_to_sheet is what will fail for large files, it requires you to build a large json object, which will increase the chances for memory related errors
you would want to build the sheet line by line using array-of-arrays-input
or cell by cell using the keys/values on the worksheet object, it basically requires you to understand how the spreadsheet format uses generic objects
i wouldnt really expect either approach to be faster than using N/compress. Libraries like sheet js include javascript code to do the compression and that code just runs badly in suitescript
the primary advantage is that using sheet js should have been easier to write since it already has logic on how to build excel files