Typo in README.md? #327

Closed
opened 2015-12-01 11:15:15 +00:00 by cskaandorp · 3 comments
cskaandorp commented 2015-12-01 11:15:15 +00:00 (Migrated from github.com)

Hi,

Great pacakage. I am a Meteor user and got into a lot of trouble with trying to write a workbook to a blob.
In your description, under Writing Workbooks > Write to binary string, you have this piece of code:

function s2ab(s) {
  var buf = new ArrayBuffer(s.length);
  var view = new Uint8Array(buf);
  for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
  return buf;
}

/* the saveAs call downloads a file on the local machine */
saveAs(new Blob([s2ab(wbout)],{type:""}), "test.xlsx")

I am most definitely not an expert!! But the code above did not work. Upon closer inspection I found it curious that 'buf' got returned and not 'view' in s2ab. When I changed buf into view, and removed the array-brackets over s2ab in the saveAs, everything worked.

As I said, I am an amateur, could you please review this?

Thanks,

Casper

Hi, Great pacakage. I am a Meteor user and got into a lot of trouble with trying to write a workbook to a blob. In your description, under Writing Workbooks > Write to binary string, you have this piece of code: ``` javascript function s2ab(s) { var buf = new ArrayBuffer(s.length); var view = new Uint8Array(buf); for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; return buf; } /* the saveAs call downloads a file on the local machine */ saveAs(new Blob([s2ab(wbout)],{type:""}), "test.xlsx") ``` I am most definitely not an expert!! But the code above did not work. Upon closer inspection I found it curious that 'buf' got returned and not 'view' in s2ab. When I changed buf into view, and removed the array-brackets over s2ab in the saveAs, everything worked. As I said, I am an amateur, could you please review this? Thanks, Casper
reviewher commented 2017-01-03 17:32:31 +00:00 (Migrated from github.com)

Hello Casper!

The code in the README was taken from http://sheetjs.com/demos/writexlsx.html . Can you check whether that demo works?

Actually, there is one difference in the saveAs line. Can you try:

saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), "test.xlsx")
Hello Casper! The code in the README was taken from http://sheetjs.com/demos/writexlsx.html . Can you check whether that demo works? Actually, there is one difference in the saveAs line. Can you try: ``` saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), "test.xlsx") ```
cskaandorp commented 2017-01-09 15:07:21 +00:00 (Migrated from github.com)

Hey Reviewher,

Thanks for getting back to me. I had this issue in December 2015, in the months after that I kind of ran away from Meteor. Sorry, I can't check try this anymore.

Good luck,

Cspr

Hey Reviewher, Thanks for getting back to me. I had this issue in December 2015, in the months after that I kind of ran away from Meteor. Sorry, I can't check try this anymore. Good luck, Cspr
reviewher commented 2017-03-13 04:58:36 +00:00 (Migrated from github.com)

@cskaandorp what a glowing recommendation of meteor /s We'll wait for the next report

@cskaandorp what a glowing recommendation of meteor /s We'll wait for the next report
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#327
No description provided.