Problem with BackgroundColor and FillPattern
Posted: Mon Nov 20, 2017 2:49 pm
I'm using an indexed color and a fill pattern, but I am unable to set the pattern background color. Only the pattern foreground color is set, wich is different from XLSSUIT4.

Left is the result of XLSSUIT6, right the result of XLSSUIT4. What can I do to fix this issue?
XLSSUIT Version 6:
XLSSUIT Version 4:

Left is the result of XLSSUIT6, right the result of XLSSUIT4. What can I do to fix this issue?
XLSSUIT Version 6:
Code: Select all
try
LDoc := TXLSReadWriteII5.Create(nil);
LDoc.Sheets[0].AsString[3,3] := '';
LFormat := LDoc.CmdFormat;
LFormat.BeginEdit(LDoc[0]);
LFormat.Fill.BackgroundColor.IndexColor := xcBlueGreen;
LFormat.Fill.PatternStyle := efpLightGrid;
LFormat.Apply(3, 3);
LDoc.Filename := 'C:\TEMP\GRID.XLSX';
LDoc.Write;
finally
freeAndNil(LDoc);
end;
Code: Select all
try
LDoc := TXLSReadWriteII4.Create(nil);
LDoc.Sheets[0].AsString[3,3] := '';
LCell := LDoc.Sheets[0].Cell[3,3];
LCell.FillPatternBackColor := xcBlueGreen;
LCell.FillPatternPattern := efpLightGrid;
LDoc.Filename := 'C:\TEMP\GRID.XLS';
LDoc.Write;
finally
freeAndNil(LDoc);
end;