I'm having a difficult time finding the magic code to have the row auto size to fit the text when printing.
In the image clip below, note that the row below the "2PM HARVEY HARVE" will not auto resize when the text is wrapped, making the cell unreadable. Having the whole row resize to accomodate this single column text is acceptable (how to do it). My preference isn't calculate the height of each text and manually set the height, unless there's an API call within the component set that I'm not aware of.
This is the basic code I'm using. the "t" is part of a tuple I'm using to pass in properties and other dynamic data that I'm using to build a cell within the context of the cell. The sched is an object that is having it's content placed into the spreadsheet.
Let me know if you need additional information regarding the code.
var propValue = t.Item2;
//Setup cell format/color here
var fmt = xls.GetCellVisibleFormatDef(celly, cellx);
fmt.Borders.Left.Style = TFlxBorderStyle.Thin;
fmt.Borders.Left.Color = TExcelColor.Automatic;
fmt.Borders.Right.Style = TFlxBorderStyle.Thin;
fmt.Borders.Right.Color = TExcelColor.Automatic;
fmt.Borders.Top.Style = TFlxBorderStyle.Thin;
fmt.Borders.Top.Color = TExcelColor.Automatic;
fmt.Borders.Bottom.Style = TFlxBorderStyle.Thin;
fmt.Borders.Bottom.Color = TExcelColor.Automatic;
fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
byte[] bytes = BitConverter.GetBytes(PropertyHelper.GetIntValue(sched, t.Item3));
fmt.FillPattern.BgColor = TUIColor.FromArgb(bytes[1], bytes[2], bytes[3]);
fmt.FillPattern.FgColor = fmt.FillPattern.BgColor;
fmt.HAlignment = t.Item4.HAlignment;
fmt.VAlignment = TVFlxAlignment.center;
fmt.Font.Style = TFlxFontStyles.Bold;
fmt.WrapText = t.Item4.WordWrap;
if (t.Item4.WordWrap)
fmt.Format = "@";
fmt.ShrinkToFit = true;
xls.SetCellFormat(celly, cellx, xls.AddFormat(fmt));
xls.SetCellValue(celly, cellx, PropertyHelper.GetValueAsString(sched, propValue));
//Setup cell format/color here
var fmt = xls.GetCellVisibleFormatDef(celly, cellx);
fmt.Borders.Left.Style = TFlxBorderStyle.Thin;
fmt.Borders.Left.Color = TExcelColor.Automatic;
fmt.Borders.Right.Style = TFlxBorderStyle.Thin;
fmt.Borders.Right.Color = TExcelColor.Automatic;
fmt.Borders.Top.Style = TFlxBorderStyle.Thin;
fmt.Borders.Top.Color = TExcelColor.Automatic;
fmt.Borders.Bottom.Style = TFlxBorderStyle.Thin;
fmt.Borders.Bottom.Color = TExcelColor.Automatic;
fmt.FillPattern.Pattern = TFlxPatternStyle.Solid;
byte[] bytes = BitConverter.GetBytes(PropertyHelper.GetIntValue(sched, t.Item3));
fmt.FillPattern.BgColor = TUIColor.FromArgb(bytes[1], bytes[2], bytes[3]);
fmt.FillPattern.FgColor = fmt.FillPattern.BgColor;
fmt.HAlignment = t.Item4.HAlignment;
fmt.VAlignment = TVFlxAlignment.center;
fmt.Font.Style = TFlxFontStyles.Bold;
fmt.WrapText = t.Item4.WordWrap;
if (t.Item4.WordWrap)
fmt.Format = "@";
fmt.ShrinkToFit = true;
xls.SetCellFormat(celly, cellx, xls.AddFormat(fmt));
xls.SetCellValue(celly, cellx, PropertyHelper.GetValueAsString(sched, propValue));