Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: 17 MB a WB with only one WS having 29 rows and 11 columns???

$
0
0
The problem is that you're explicitly formatting 1M+ cells (cells which ClosedXML needs to create). You have to either format the entire column or only format the cells used. There are many ways you can do this but here are some examples:
        ws.Column(3).Style.NumberFormat.Format = "$ #,##0.00";

        ws.RangeUsed().Column(3).Style.NumberFormat.Format = "$ #,##0.00";

        ws.Column(3).Column(2, ws.LastRowUsed().RowNumber()).Style.NumberFormat.Format = "$ #,##0.00";

        ws.Range(2, 3, ws.LastRowUsed().RowNumber(), 3).Style.NumberFormat.Format = "$ #,##0.00";

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>