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

Is there a streaming model? #25

Closed
casperOne opened this issue Dec 8, 2019 · 1 comment
Closed

Is there a streaming model? #25

casperOne opened this issue Dec 8, 2019 · 1 comment

Comments

@casperOne
Copy link

Thanks for this, the library resonates greatly with my by taking a functional and compositional approach to generating Excel sheets

That said, I'd love to migrate to this, but I can't tell if it supports the following scenarios:

Very Large Sheets/Streaming Model

There are sheets that I currently produce which produce out of memory errors for other libraries, so I generally like to use streaming models where available.

Is there an ability to stream content/changes through the model to the final destination (with limitations on what we can write and where of course) or is the model contained completely in memory before written out to bytes?

Write to Stream

I generate Excel sheets in ASP.NET Core and I'd prefer to not allocate large byte arrays where possible

Is it possible to write to a Stream directly?

@zhenyagusev
Copy link
Contributor

It's great that more people share the view to making xlsx in BookFx way.

Yes, the model should be placed in memory before it will be rendered and packed into the xlsx. BookFx creates an xlsx in several phases:

  1. Describing. You make the BookFx model from your data.
  2. Validating. BookFx validates the BookFx model.
  3. Proto-banking (optional). If prototypes are used, BookFx opens their xlsx files and puts they into the ProtoBank.
  4. Calculating. BookFx calculates coordinates and sizes of boxes (places boxes on sheets).
  5. Rendering. BookFx makes the EPPlus model.
  6. Packing. EPPlus packs the xlsx.

It is possible to enable the stream mode at the 6 phase only. This will allow us to get the EPPlus output stream. But I don't see the much point to do this, because if a very large sheet can produce an out of memory error, it will happen before packing. Nevertheless, we can try to do an experiment with the streaming at the 6 phase. And, if it will be useful, we can add a stream mode.

What is the very large sheet?

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