08-03-2011 01:23 PM
I want to substitute the Label strings of the Ring (Label/Value Pairs) after starting the program with strings read from the Excel Spreadsheet or some text file. I know how to implement this part but I don't know how to set Label using attribute command. I found command to set the Label of the ring but I want to modify Labels of Label/Value pairs so the user can modify them depending on the devices names:
Value Label
1 Device1
2 Device2
3 Device3
Thank you for your help.
Leszek
Solved! Go to Solution.
08-03-2011 01:31 PM
Hi,
have a look at InsertListItem (), ReplaceListItem () and DeleteListItem ().
Good luck,
Wolfgang
08-04-2011 09:14 AM
Wolfgang,
Thank you very much. It was pretty easy to implement, but it was not obvious for me to find the solution, because I was looking for atributes.
So I read the string from the Excel and I subsitute the default labels from Label/Value pair with the string read from Excel using "ReplaceListItem"
error = ExcelRpt_GetCellValue (rawDataWorkSheetHandle, "B2", ExRConst_dataString, &value_1);
error = ExcelRpt_GetCellValue (rawDataWorkSheetHandle, "B3", ExRConst_dataString, &value_2);
error = ExcelRpt_GetCellValue (rawDataWorkSheetHandle, "B4", ExRConst_dataString, &value_3);
error = ExcelRpt_GetCellValue (rawDataWorkSheetHandle, "B5", ExRConst_dataString, &value_4);
status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 3, value_1, 0); //Replace laser 1 name
status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 2, value_2, 1); //Replace laser 2 name
status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 1, value_3, 2); //Replace laser 3 name
status = ReplaceListItem (AgilisInterfaceTabHandle, TAB_AGILIS_CHANNEL, 0, value_4, 3); //Replace laser 4 ame
Leszek
08-04-2011 10:54 AM
I am glad all went smoothly - a quantum of solace may be that e.g. tables, tabpanels etc. require even more search/experience: the more complex the control...