Build 3.0.0.45 of xlsgen continues on previous builds engineering a new visual component : geomaps.
Geomaps in business intelligence scenariosThis 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.