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

Skip Navigation Links.

Util Class

The Util class encapsulates utility functions for the report generator. For those familiar with ASP, the the Util object is the equivalent of the ASP's Server object.

Method Description
FirstNonEmpty(object1, object2, ...) Returns the first non empty object in the list. If the list is composed on empty objects, the method returns the last object (which is empty). This method is very useful to pick a value from a list, such as a first name, middle name, nick name, last name.
FormatHtmlHyperlink(href, [text], [attributes]) Builds an hyperlink
FormatPhrase(strTemplate, ...) Builds a phrase from a format template and data arguments.
FormatString(strTemplate, ...) Builds a string from a format template and data arguments.
GetHeight(strDimension) Returns the height of dimension provided in format: 800x600
GetStatisticsForIndividuals(ind[]) Returns a number that represents the amount of information in the individual.
GetWidth(strDimension) Returns the width of dimension provided in format: 800x600
HrefEncode(str) Friendly method to make sure the URL does not have invalid characters, while keeping some punctuation characters allowed in the URL syntax.
HtmlDecode(str) Removes all HTML tags, comments and replace the entities (nbsp, quot, apos, lt, gt, amp) by their Unicode equivalent. The <br /> tag is replaced by the new line CRLF pair. The method returns an empty string if the input string is empty.
HtmlEncode(str) Converts a string into its HTML equivalent. This method is useful for displaying text that may contain "special" HTML characters.
IfElse(expression, truePart, falsePart) Returns the correct value based on a boolean expresion. Works the same way as IIf in VB.
IfCollection(object) Returns if the object is a collection.
IsNothing(object) Returns true if the object variable is empty or has no data.
JavaScriptEncode(str) Encodes a string by escaping quotes and other special characters to JavaScript.
NewDataSorter() Allocates an empty DataSorter.
NewGenoCollection() Allocates an empty collection of objects.
NewNameDictionary() Allocates an empty NameDictionary.
NewObjectRepertory() Allocates an empty ObjectRepertory.
NewStringDictionary() Allocates an empty StringDictionary.
StrFirstCharUCase(str) Returns the string with the first letter in uppercase.
StrGetFirstChar(str) Gets the first character of the Unicode string. The returned value is a string because a Unicode character may require up to 32 bits.
StrStripAccents(str) Removes all accents to the string while preserving case and punctuation.
StrStripAccentsLCase(str) Removes all accents while converting the string to lowercase. Punctuation is preserved.
StrStripAccentsUCase(str) Removes all accents while converting the string to uppercase. Punctuation is preserved.
StrStripPunctuation(str) Removes any punctuation character from the string such as space, quotes, underscore, dot, dash, parenthesis, and so on.
UrlDecode(str) Decodes an URL-encoded string to produce a normal string.
UrlEncode(str) Encodes any space and non-alphanumeric characters to produce a valid URL.
XmlEncode(str) Encodes a string according to the XML rules. This method is very similar to HtmlEncode. Use this method if you need to create an XML document.

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