0

I am trying to use JSSheet in my Netsuite application. I have imported the file xlsx.core.min.js.

I was told by Netsuite the file is retrieved as Base64 text. However when I try to use it I get the following error:

var workbook = XLSX.read(base64text);

error: TypeError: org.mozilla.javascript.Undefined@224c1fae is not a function, it is undefined. (xlsx.js#11374)

I don't understand this error. What is the proper syntax. I even tried:

XLSX.read(base64text, {type: 'base64'});

thoughts?

jimijon
  • 2,046
  • 1
  • 20
  • 39

1 Answers1

0

Sounds like it's trying to read from a DOM library which isn't available on NS server-side.

How are you importing this?

felipechang
  • 916
  • 6
  • 14
  • Well Netsuite allows you to include scripts for the script you are working with so I just imported it that way. After looking at line 11374 it looks as though it needs jszip.js. So I imported that too to no avail. – jimijon Jul 17 '15 at 12:14
  • Haven't read the library in depth but it seems to "require" quite a few things and use nodejs specific objects. You might have more luck finding the parts you want to use and hack together the pieces to work together. Or use a client-side library and tweak it to work without the DOM. – felipechang Jul 23 '15 at 00:37