Passing Collections Simply

Valid from List & Label 9
If your variables or fields are already available in a Key...Value collection, the collection object can be passed directly to List & Label. The overloaded method iterates automatically through the collection and declares the entries as variables or fields. It is also no longer necessary to name the variable, this information is taken directly from the collection.
Hashtable customer = new Hashtable();
customer.Add("Firstname", "John");
customer.Add("Lastname", "Doe");
LL.Variables.AddFromDictionary(customer);


Additionally, you may add the collection to the variable hierarchy tree. Simply pass an additional parameter for the folder where you would like your variables to be placed.

Hashtable customer = new Hashtable();
customer.Add("Firstname", "John");
customer.Add("Lastname", "Doe");
LL.Variables.AddFromDictionary("Customer", customer);


This call declares the following variables:

Customer.Firstname
Customer.Lastname


List & Label supports the direct passing of instances of the NameValueCollection class (used mainly for WebReporting with ASP.NET) as well as any class supporting the IDictionary interface (e.g. HashTable, SortedList, and so on).

IDKBTE000522 KBTE000522