Build 4.0.0.32 of xlsgen adds exposure to gradient fills in cells in the object model.
Gradient fill in cellsThis exposure makes it possible to add such gradient fills in XLSX files and their variants (XLSM, XLSB, ...), by adding the corresponding property in the
IXlsPattern interface (regular style object). You can choose both colors, the gradient style (orientation, ...) and you can disable an existing gradient fill in a cell.
Of course, also xlsgen renders those gradient fills in print, preview, PDF, etc. But this has been the case for some time already, including the rendering of gradient fills of BIFF12 records in XLS files (written by Excel 2007 and above for compatibility reasons).
The automatic source code generator also exposes the corresponding source code so in the event you would like to use this feature, you can create it manually in Excel and then use the automatic source code generator to get the lines of code.
Here is an example source code :
xlsgen::IXlsStylePtr style = worksheet->NewStyle();
xlsgen::IXlsGradientPatternPtr gp = style->Pattern->Gradient;
gp->FirstColor = 0xFFFF00;
gp->SecondColor = 0xFF0000;
gp->GradientStyle = xlsgen::gradientstyle_verticall2;
style->Apply();