GenoPro Developer Home
GenoPro Home  |  SDK Home  |  Report Generator  |  Support  |  Search  |  Help  |  Site Map

Skip Navigation Links.

GenoCollection Class

A collection is an ordered set of items encapsulated into a single object. The GenoCollection class provides a convenient way to refer to a related group of items as a single unit. For instance, a collection may include all the children of a given individual. This collection may be sorted using a specific sort key such as the child's name or age before being written to the report. The GenoCollection has multiple methods and properties, however the most popular methods are ToString and ToHtmlHyperlinks.

Methods Description
Add(oItem | oCollection) Adds an item or a collection to the collection object. This operation may produce duplicates.
AddUnique(oItem) Appends an object to the collection. If the object is already there, it does nothing. Return the index where the object can be accessed in the collection.  
Clear Empties the collection.
Clone Creates an identical copy of the collection.
Remove(oItem | oCollection) Removes an item or a collection from the collection.
RemoveDuplicates Removes any duplicate entries from the collection.
Reverse Reverses the order of the collection.
SortBy(strSortKeys) Sorts the collection using one or multiple sort keys.
SortByGender Special sort; Group the individuals by males, females and unknown gender.
ToHtmlHyperlinks(...) Returns a formatted string containing an HTML hyperlink for each item in the collection. Again, this method has multiple parameters to format the hyperlink.
ToHtmlHyperlinksNN(...) Same as ToHtmlHyperlinks, however empty values are substituted by _NoName from the dictionary.
ToString(...) Converts the entire collection into a string. This method has multiple parameters such as the tag value, the text to substitute in case of an empty value and the list separator.

At the moment, the collection has only two properties. More to come in the future.

Properties Description
Count Read-only. Return an integer containing the number of items the collection.
Item(iPosition) Read-only. Returns a specific member of the collection by position. The index is zero-based.

To access a built-in collection such as all the individuals or pictures, use the property ReportGenerator.Document.Collection. To create a new empty collection, use the method Util.NewGenoCollection.

 

Copyright ┬ę 1998-2014. All rights reserved. GenoPro┬« and the GenoPro logo are registered trademarks.