xlsgen > overview > Traffic lights

 


Traffic lights in xlsgen

 

Traffic lights

Traffic lights need not much explanation, but how they can be programmed is obviously needed. They can be programmatically set to reflect levels or states that are part of business decision making. They have the following properties :

 

Here is the table of parameters :

NameTypeDescription
SetGreenThresholdinteger or doublevalue below which traffic light signals green. Default value is 0.
SetOrangeThresholdinteger or doublevalue around which traffic light signals orange. Default value is 50.
SetRedThresholdinteger or doublevalue above which traffic light signals red. Default value is 100.
SetVerticalbooleanforce the orientation of the traffic light(s)
SetValueinteger or double (or range of integers or doubles)value itself or range of values.
SetTitlestring (or range of strings)title or range of titles.
ResetValuesNonedeletes current value(s).

 

Creating traffic lights

C/C++ code

xlsgen::IXlsEnginePtr engine( __uuidof(xlsgen::CoXlsEngine) );

xlsgen::IXlsWorkbookPtr wbk = engine->New( L"trafficlights.xlsx" );

xlsgen::IXlsWorksheetPtr wksht = wbk->AddWorksheet( L"Sheet1" );

xlsgen::IXlsVisualComponentPtr comp = wksht->NewVisualComponent(L"TrafficLight.ARsTdesign.1",
       2,5, // row1, col1
       6,8, // row2, col2
       0,0,0,0);

// three traffic lights
comp->ParameterByName[L"SetVertical"]->Formula = L"=TRUE";
comp->ParameterByName[L"SetValue"]->Formula = L"={80;50;70}";
comp->ParameterByName[L"SetTitle"]->Formula = L"={\"my title (80)\";\"2nd title\";\"3rd title\"}";

wbk->Close();

 

xlsgen documentation. © ARsT Design all rights reserved.