XEROF

 

xlsgen 3.0 build #45 : Geomaps (IV)


Build 3.0.0.45 of xlsgen continues on previous builds engineering a new visual component : geomaps.


Geomaps in business intelligence scenarios

This build enables business intelligence scenarios by allowing to pass column names as parameter(s) in geomaps, making it extremely easy to setup.

Passing column names abstracts away all the fragile cell references. xlsgen creates and maintains all this for you.

Here is a sample code. In our business intelligence scenario we have an input Excel file with two columns, one is the country the other is the sales per country. We would like to draw the corresponding geomaps. Here is how to do it (here in C++) :


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

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

wksht->Tables->InferFromWorksheet();

xlsgen::IXlsTableVisualComponentPtr vc = wksht->Tables->Item[1]->DataResults->TurnToVisualComponent(L"Geomaps.ARsTdesign.1");

vc->Formula[L"SetTitle"] = L"=\"Sales (millions)\"";
vc->Formula[L"SetRegions"] = L"=[Country]";
vc->Formula[L"SetLabels"] = L"=[Sales (millions)]";
vc->Formula[L"SetColors"] = L"=IF([Sales (millions)]>=10;\"00FF00\";\"FF0000\")";
vc->Formula[L"SetLegends"] = L"=IF([Sales (millions)]>=10;\"> 10 millions\";\"< 10 millions\")";
vc->Formula[L"SetBackgroundColor"] = L"=13421772"; //0xCCCCCC;
vc->Formula[L"SetLabelType"] = L"=8"; // text
vc->Apply();

xlsgen::IXlsWorksheetPtr wksht_new = wbk->AddWorksheet(L"new");
wksht_new->InsertTableAt(wksht->Tables->Item[1], 5, 3);
wksht_new->PageSetup->PageOrientation = FALSE;
wksht_new->Export->ExportAsPDF(L"geomaps.pdf");

wbk->Close();


Notice how column names such as [Sales (millions)] are used in color and legend formulas in order to tag countries red or green depending on the sales.

Posted on 19-July-2012 14:02 | Category: xlsgen, Excel generator | comment[0] | trackback[0]

 

 

<-- previous page

< July >
0102030405
0607080910
1112131415
1617181920
2122232425
2627282930
31



 

 

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)