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

New Post: Tables with Empty Cells

$
0
0
I'm creating a report where labels are on the top and left of a worksheet and data resides at the intersection of the labels. The following code is able to get me the appearance that I want. However, the document resulting from ClosedXML is 20MB in size. Most of the cells in the workbook are blank, and re-saving the document from Excel reduces the file size to 1MB.
public static void ToExcel (DataTable table, string fileName)
{
   var workbook = new XLWorkbook ();
   var worksheet = workbook.AddWorksheet (table.TableName);
   worksheet.Cell (1, 1).InsertTable (table);
   worksheet.SheetView.Freeze (1, 1);
   workbook.SaveAs (fileName);
}
I submitted this pull request with a fix for the issue. Is there anything I can do to facilitate it's adoption so that my team is not maintaining our own fork? Or, do you have another suggestion for how to work around this?
https://closedxml.codeplex.com/SourceControl/network/forks/ericlamb/closedxml/contribution/7561

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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