xlsgen bug fixes

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

 

xlsgen 2.9 build #47 : Auto-adjusting named ranges


Build 2.9.0.47 of xlsgen adds auto-adjusting capabilities.

Automatically adjusting named ranges is an optional mechanism in xlsgen which automatically updates named ranges according to the update of the underlying data being referenced.

Here is a simple example below.


Auto-adjusting named ranges

On the left side, we initially have a bunch of rows and a named range myrange. Then when the data is updated, a new row is added (Product13). Thanks to xlsgen's built-in auto-adjusting named ranges enabled, the named range myrange gets automatically updated, on the right side of the capture below.

Here is how to do it, in C++ :

xlsgen::IXlsWorksheetPtr wksht = wbk->WorksheetByIndex[1];

// will return areaBeforeUpdate = R2C1:R14C5
_bstr_t areaBeforeUpdate = wksht->Range[L"myrange"]->Range;

// enable auto-adjusting of named ranges
wbk->AutoAdjustDefinedNames = TRUE;

// insert a new row of data
wksht->Label[15][1] = L"Product13";

// will return areaAfterUpdate = R2C1:R15C5, notice the change
_bstr_t areaAfterUpdate = wksht->Range[L"myrange"]->Range;

Posted on 04-February-2010 14:56 | Category: xlsgen, Excel generator

 

 

<-- previous page