Represents all the values associated with the different types of limits—regular, computed, and aggregate. Each limit object has three LimitValues collections: AvailableValues (Collection), SelectedValues (Collection), and CustomValues (Collection). The AvailableValues (Collection) is used for regular limits only.
All collections have the “Item(NameOrIndex)” method. This is the default method for all collections that returns collection items at a particular index or by name. Use brackets ([]) to represent calls to the Item (Method). For example, these statements are identical: myItem = Documents[1] myItem = Documents.Item(1) myItem = Documents["StartUp.bqy"] myItem = Documents.Item("StartUp.bqy") |
This example shows how to add all values in AvailableValues (Collection) to the SelectedValues (Collection). This is the same as performing a select all values and transferring the selection in the Limit User Interface:
LimitCount = ActiveDocument.Sections["Results"].Limits[1]. AvailableValues.Count for (i=1;i<=LimitCount;i++) { MyVal = Add(ActiveDocument.Sections["Results"].Limits[1]. AvailableValues[i] ActiveDocument.Sections["Results"].Limits[1]. SelectedValues.Add(MyVal) }
This example adds a CustomValue to the computed item limit:
ActiveDocument.Sections["Query"].Limits[2]. CustomValues.Add(‘2’)
This example shows how to pass selected values from a pulldown list into a limit in the results set:
ActiveDocument.Sections["Results"].Limits[1].SelectedValues.RemoveAll(); NumSelected=Listbox.SelectedList.Count; for (var i=1; i<=NumSelected; i++) { ActiveDocument.Sections["Results"].Limits[1].CustomValues.Add(Listbox.SelectedList.Item(i)); ActiveDocument.Sections["Results"].Limits[1].SelectedValues.Add(Listbox.SelectedList.Item (i)); };
Add(ValueItem), AddAll(), Item(Index As Number), RemoveAll()
For the AvailableValues (Collection), the Add (Method) does nothing, because the values are obtained from the database. |