ClosedXML / ClosedXML.Report

ClosedXML.Report is a tool for report generation with which you can easily export any data from your .NET classes to Excel using a XLSX-template.
https://closedxml.github.io/ClosedXML.Report/
MIT License
514 stars 108 forks source link

Forcibly remove a range representing a table if its data source is empty (#251) #323

Closed Pankraty closed 10 months ago

Pankraty commented 10 months ago

Closes #251

For rendering tables, ClosedXML.Report uses a temporary worksheet where it creates a whole table which then is copied to the original worksheet. But when the datasource for the table is empty, no data gets rendered on the temp worksheet and this caused incorrect buffer copying that corrupted ranges below.

With this fix, we prevent empty tables from rendering and remove the template rows (preserving an options row, if necessary).

eagleoriginal commented 5 months ago

Hellow. After force remove empty list. Pivot Table that was pointed to deleted range make file broken. And Excel restore file but without Pivot table. And It is supposed that pivot will show Zeroes, not be delted at all. So i would recomment to revert changes in commit a38eda3a3a7092812c8358a949d4e489635501bf