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

Stream while appending to xlsx #753

Closed
sfroment opened this issue Dec 21, 2020 · 4 comments
Closed

Stream while appending to xlsx #753

sfroment opened this issue Dec 21, 2020 · 4 comments

Comments

@sfroment
Copy link

I would like to know if there's was a way I can at the same time use a streamWriter, and file.WriteTo in order for writeTo to write on the io.Writer when I call streamWriter.Flush, and then on the second call it only writes the missing parts ?

@xuri
Copy link
Member

xuri commented Dec 22, 2020

Hi @sfroment, streamWriter.Flush just flush data on a single worksheet after writing data at once, and then WriteTo will prepare and writing the workbook data into io.Writer. Since workbook data depends on the finished worksheet data writing, so we can't call these at the same time.

@sfroment
Copy link
Author

sfroment commented Dec 22, 2020

Thanks for the quick answer ! I've understood that, I think I haven't explained well what I want to do. I would like to stream the download while I build the excel sheet. I know it's not possible with the current implementation, but would it be possible or does the library need to have all the sheets built before writing ?

@xuri
Copy link
Member

xuri commented Dec 22, 2020

With the spreadsheet specification limit (OPC part), the workbook serialization should be waiting all worksheet has been ready. If you need process with amount of data, please try separate it into multiple spreadsheet files if you can.

@sfroment
Copy link
Author

Thanks !

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

No branches or pull requests

2 participants