Cell background color is not set using DefaultFormat
Posted: Fri Mar 09, 2018 8:23 am
Hello !
I'm using XLSReadWriteII 6.32 to create a XLS file ('97).
I use XLS.CmdFormat to create a default format.
In this default format, I define some properties about Alignment, Font, Border, and Fill.
In my case, I set the cell background color like this (please tell me if I'm wrong, I read that only RGB property is used in the FormatCells Sample to set background, does it mean IndexColor is not recommended ?) :
Then I add as default the format :
Finally, I write in my cell with the required format like this :
And when I open my document, everything is fine about alignment, font, and border, but my background color is not set.
Thank you and best regards.
I'm using XLSReadWriteII 6.32 to create a XLS file ('97).
I use XLS.CmdFormat to create a default format.
In this default format, I define some properties about Alignment, Font, Border, and Fill.
In my case, I set the cell background color like this (please tell me if I'm wrong, I read that only RGB property is used in the FormatCells Sample to set background, does it mean IndexColor is not recommended ?) :
Code: Select all
XLS.CmdFormat.Fill.BackgroundColor.IndexColor := _format.FillPatternBackColor;
Code: Select all
XLS.CmdFormat.AddAsDefault('F' + IntToStr(formatCount));
Code: Select all
XLS.DefaultFormat := XLS.CmdFormat.Defaults.Find('F' + IntToStr(_fmtIdx));
XLS[curSheet].AsFloat[_col, _row] := _number;
Thank you and best regards.