Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load and use xlsx in browser env [help wanted] #1055

Open
iabukai opened this issue Dec 18, 2019 · 2 comments
Open

Load and use xlsx in browser env [help wanted] #1055

iabukai opened this issue Dec 18, 2019 · 2 comments

Comments

@iabukai
Copy link

iabukai commented Dec 18, 2019

I have a NuxtJs/Vuetify application and I try to use my xlsx template from my static resources then add data and then save the file with the updated data.
I tried this :

const workbook = new Excel.stream.xlsx.WorkbookReader({ filename: '/static/template.xlsx' })
      workbook.xlsx.writeBuffer()
        .then(buffer => saveAs(new Blob([buffer]), `${this.asd.date} ${this.asd.place} .xlsx`))
        .catch(err => console.log('Error writing excel export', err))

But he downloaded xlsx was corrupted.
saveAs coming from : import { saveAs } from 'file-saver'

@Siemienik
Copy link
Member

Did you attempt to use (new Excel{}).xlsx.readFile(/*...*/).then(/*...*/); ? I suppose, that your code didn't read any data before writeBuffer.

@Siemienik
Copy link
Member

#354

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants