I cannot find a way to autofit row height using the EPPlus Excel library. When I used Excel Interop, I could do sheet.Rows.AutoFit(). I\'m looking around the in
Another twist to this that has taken me hours to figure out: How to enable word wrap in a given column or row. This is how I did it:
(Horizontal and vertical alignments have been set to "Center")
// Increase the height of the header row by .5
// (The height is already at 2 times the default value)
wsDT.Row(1).Height *= 1.5;
// Column index to Notes, Anniversary Month and Day
// add "1" since column index is relative to 0
int colIdx = dt.Columns.IndexOf("Notes") + 1;
// Set the column width
// This is a long text field - so width and word wrap are set
wsDT.Column(colIdx).Width = 50;
wsDT.Column(colIdx).Style.WrapText = true;
// Set width of anniversary month column
// Purpose here is to wrap header text
colIdx = dt.Columns.IndexOf("Lease Anniversary Month") + 1;
wsDT.Column(colIdx).Width = 15;
wsDT.Column(colIdx).Style.WrapText = true;
Header row showing wrapped text and set width Contents of "Notes" row has wrapped text when appropriate