xlsgen bug fixes

Generate Excel files. Speed. Flexibility. Depth. Robustness.

 

xlsgen 2.9 build #46 : Formula-based selection


Build 2.9.0.46 of xlsgen introduces a capability that is not available in Excel. It's the ability to build ranges based on formulas.

One of the obvious uses for this is the style formatting, for instance change the color of all cells whose value is greater than a given threshold, but obviously any functionality exposed at the range-level is available as well.

In the code sample below, what is shown is how to change the color of all cells greater than 20.


Formula-based selection

And the corresponding source code (C++) is :

// build a range of cells governed by value > 20
// notice the use of relative cell references in : F2 > 20
xlsgen::IXlsRangePtr r = wksht->NewRange(L"F2:F14")->SelectByFormula(L"F2 > 20");

// returns s = R2C6:R3C6;R9C6:R11C6
_bstr_t s = r->Range;

// apply color to those cells
r->Style->Pattern->Pattern = xlsgen::pattern_solid;
r->Style->Pattern->BackgroundColor = 0xFF0000;

r->Apply();

Posted on 27-January-2010 12:33 | Category: xlsgen, Excel generator

 

 

<-- previous page