XEROF

 

xlsgen 2.9 build #9 : Range helper : auto-fill



Auto-filling a range with data (two examples, one with formulas, another with numbers)

Auto-filling a range in xlsgen is the programmatic way by which it is possible to drag a selection in Excel vertically or horizontally and see the extension filled with data relevant to the data in the selection.

Formulas are replicated (the cell references are updated accordingly). Strings are replicated as is. Numbers are replicated by taking into account the difference between numbers in the data selection. The formatting is replicated.

The selection is defined by its depth. The depth means the height of the selection in case the fill is vertical. And the depth means the width in case the fill is horizontal. It is therefore possible to choose to auto-fill vertically or horizontally.

In the examples above, auto-fill is used for replicating formulas vertically, and numbers vertically. Since there is only one formula in the selection, the depth is set to 1. In the other example, numbers are replicated. The selection has three numbers, which implies the depth is set to 3. If the depth was set to 1 or 2, the result would be entirely different. Indeed the selection depth is used to infer the differences between numbers. The algorithm is always linear.

C++ code

xlsgen::IXlsWorkbookPtr wbk = engine->Open( L"data.xls", L"output.xls" );

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

// auto-fill vertically our formula in the selection (see example above)
wksht->NewRange(L"C3:C11")->AutoFill(1);

wbk->Close();


Posted on 25-June-2009 17:46 | Category: xlsgen, Excel generator | comment[0] | trackbacks[3]

 

 

<-- previous page

< June >
0102030405
0607080910
1112131415
1617181920
2122232425
2627282930



 

 

This site
Home
Articles

DevTools
CPU-Z
EditPlus
ExplorerXP
Kill.exe
OllyDbg
DependencyWalker
Process Explorer
autoruns.exe
Araxis
COM Trace injection
CodeStats
NetBrute
FileMon/Regmon
BoundsChecker
AQTime profiler
Source monitor
GDI leaks tracking
Rootkit revealer
Rootkit removal
RunAsLimitedUser(1)
RunAsLimitedUser(2)

 

 

Liens
Le Plan B
Un jour à Paris
Meneame
Rezo.net (aggr)
Reseau voltaire
Cuba solidarity project
Le grand soir
L'autre journal
Le courrier suisse
L'Orient, le jour
Agoravox (aggr)