A bindingName specifies a column name on which the format applies. Use double quotation marks to surround the name of the column, as shown in this example:
bindingName : "CUSTOMERNAME"
condition
A condition specifies a filter condition in the following format:
The conditions are based on actuate.model.FilterCondition, and consists of operator and operands:
An operator takes one of the values described in Table 7‑37.
Table 7‑37 Filter conditions
Operator
Description
eq
Equal, =
ne
Not equal, <>
lt
Less than, <
le
Less than, or equal, <=
ge
Greater than, or equal, >=
gt
Greater than, >
between
Between
not-between
Not between
is-null
Equal to NULL
is-not-null
Not equal to NULL
like
Checks if the column data matches a pattern
not-like
Checks if a column data does not match a pattern
Operands provide the values required by an operator to define a filtering condition. To describe a single value, use a literal operand, as shown in the example:
operator: "eq",
operands : [ { literal : 124 } ]
To describe more than one operand, for example, the values between 131 and 161:
operator: "between",
operands : [ {literal : 131},{literal : 161} ]
effect
The effect property specifies the conditional formatting. The syntax is based on actuate.model.Font class. Always consider the web browser when implementing the formatting. Not all browsers support all properties.
This example clears existing filters from the PRODUCTLINE column:
function resetFilter(myTable){
myTable.clearFilters("PRODUCTLINE");
myTable.submit( );
}
deleteColumn
Syntax
void Table.deleteColumn(string columnName)
Deletes a column from a table.
Parameter
columnName
String. The name of the column.
Example
This example deletes the PRODUCTLINE column from a table:
var pgContent = viewer.getCurrentPageContent( );
var table = pgContent.getTableByBookmark( bookmark );
table.deleteColumn( “PRODUCTLINE” );
table.submit( );
getBookmark
Syntax
string Table.getBookmark( )
Returns the Table’s name.
Returns
String. The name of the Table.
Example
This example displays the Table’s bookmark in an alert box:
function alertBookmark(myTable){
alert(myTable.getBookmark( ));
}
getColumn
Syntax
array[ ] Table.getColumn(integer columnIndex)
Gets the Table data by column index. Returns the data from the current visible page.
Parameter
columnIndex
Integer. Optional. The numerical index of the column from which to retrieve data. The getColumn( ) function returns the values for the first column when no value is provided for columnIndex.
Returns
Array. A list of data in the format of the column.
Example
This example returns the first column in myTable:
function getMyColumn(myTable) {
return myTable.getColumn( );
}
getColumnName
Syntax
void Table.getColumnName(int columnIndex)
Returns a column name based on a column index.
Parameter
columnIndex
Integer. The index of the column.
Example
This example clears existing filters from the PRODUCTLINE column:
Returns the page content to which this Table belongs.
Returns
actuate.viewer.PageContent. report content.
Example
This example displays the viewer ID of the page content in an alert box:
function showViewID(myTable){
var pageContent = myTable.getPageContent( );
var pageViewerID = pageContent.getViewerId( );
alert (pageViewerID);
}
getRow
Syntax
array[ ] Table.getRow(integer rowIndex)
Gets the Table data by row index. Returns the data from the current visible page.
Parameter
rowIndex
Integer. Optional. The numerical index of the row from which to retrieve data. The getRow( ) function returns the values for the first row when no value for rowIndex is provided.
Returns
Array. A list of data in the format of the columns that cross the row.
Example
This example retrieves the first row in myTable:
function getMyRow(myTable) {
return myTable.getRow( );
}
getType
Syntax
string Table.getType( )
Returns the report element type of this object, which is Table.
Returns
String. "Table".
Example
This example returns the report element type of this object in an alert box:
function getTableType(myTable) {
alert("Element type is: " + myTable.getType( ));
}
groupBy
Syntax
void Table.groupBy(string columnName)
Groups the data in a table by the values in a given column. If there is an existing group, this operation will add the new group after the existing group.
Parameter
columnName
String. The name of the column to use for the innermost group to the Table.
Example
This example groups the data in myTable by the values in the TOTAL column:
function groupByColumn(myTable) {
myTable.groupBy("TOTAL");
}
hide
Syntax
void Table.hide( )
Hides this element.
Example
This example hides myTable:
myTable.hide( );
hideColumn
Syntax
void Table.hideColumn(string columnName)
Hides a table column by specifying the column name.
Parameter
columnName
String. The data binding name for the column to hide.
Example
This example hides the TOTAL column from myTable:
function myHiddenColumn(myTable) {
myTable.hideColumn("TOTAL");
myTable.submit( );
}
hideDetail
Syntax
void Table.hideDetail(string columnName)
Hides information for a column from the grouped data displayed on the page. If every column is hidden, only the group name is visible.
Parameter
columnName
String. The data binding name for the column to hide.
Example
This example hides the TOTAL column from the grouped data visible for myTable:
String. The name of the column, after which the new computed column is inserted.
columnLabel
String. The label of the new computed column.
computedAttrs
JSON. The definition of the formulas and data used to calculate the new column.
The computedAttrs array must provide the following attributes:
categoryName
String. Defines the function category, as listed in Table 7‑39.
functionName
String. Defines the function name, as listed in Table 7‑39.
Arguments
The number of the arguments and their formats are different for each function. You can find their definitions in each function description later in this section.
All functions and their attributes are defined in iv_config.xml, located in the iHub or Information Console installations:
<context root>\WEB-INF
The JSON format definition of the computedAttrs parameter has the following syntax:
Calculates the percent for the selected column value in the scope of the selected base group.
Arguments
value
String. The name of the first column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The name of the second column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
expression
String. Defines an expression used in the calculation, using JavaScript syntax conventions. Use object literals { } to reference the arguments of the function in the expression.
"{0}/{1}*100%"
In the example above, {0} references the first argument of the function, in this case the value of the first column, {1} references value of the second column. The numbers 0 and 1 refer to the arguments in the order of their definition.
Example
This example creates a computed column Q1/Year, calculating the percent of the revenue at the first quarter from the total yearly revenue, by product code.
Calculates the percent of the difference between values in two numbers
Arguments
value
String. The name of the first column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The name of the second column in format. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
expression
String. Defines an expression used in the calculation, using JavaScript syntax conventions. Use object literals { } to reference the arguments of the function in the expression.
({1}-{0})/{0}*100%
In the example above, {0} references the first argument of the function, in this case the value of the first column, {1} references value of the second column. The numbers 0 and 1 refer to the arguments in the order of their definition.
Example
The example creates a computed column Q1/Year, calculating the % of difference between the first quarter and yearly revenue by product code.
String. The name of the first column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The name of the second column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
expression
String. Defines an expression used in the calculation, using JavaScript syntax conventions. Use object literals { } as the function arguments in the expression.
"{0}+{1}"
In the example above, {0} references the first argument of the function, in this case the value of the first column, {1} references value of the second column. The numbers 0 and 1 refer to the arguments in the order of their definition.
Examples
This example creates a computed column, adding the revenue from Q1 and Q2.
String. The name of the first column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The name of the second column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
expression
String. Defines an expression used in the calculation, using JavaScript syntax conventions. Use object literals { } to reference the arguments of the function in the expression.
"{0}+{1}"
In the example above, {0} references the first argument of the function, in this case the value of the first column, {1} references value of the second column. The numbers 0 and 1 refer to the arguments in the order of their definition.
Example
The example creates a computed column displaying the difference in Q1 and Q2 revenues.
Calculates the remainder value of number divided by divisor. The remainder displays the same sign as the divisor.
Arguments
value
String. Table column name, that gives the number for which you want to find the remainder. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. Divisor. The number by which you want to divide the column value.
Example
The example creates a computed column that displays the remainder of parts, considering eight parts are used in a unit.
var columnNameAfter = "Account";
var columnName = "PARTS";
var columnLabel = "Parts-Mod";
var category = "Math";
var categoryFunc = "MOD";
var arguments = [ {"value":"["+columnName+"]"},{"value":"8"}];
String. The name of the first column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The name of the second column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
expression
String. Defines an expression used in the calculation, using JavaScript syntax conventions. Use object literals { } to reference the arguments of the function in the expression.
"{0}+{1}"
In the example above, {0} references the first argument of the function, in this case the value of the first column, {1} references value of the second column. The numbers 0 and 1 refer to the arguments in the order of their definition.
Example
This example creates a computed column, multiplying the number of items ordered by the price of the item.
String. The name of the first column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The name of the second column. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
expression
String. Defines an expression used in the calculation, using JavaScript syntax conventions. Use object literals { } to reference the arguments of the function in the expression.
"{0}+{1}"
In the example above, {0} references the first argument of the function, in this case the value of the first column, {1} references value of the second column. The numbers 0 and 1 refer to the arguments in the order of their definition.
Example
This example creates a computed column for the ratio of sales from Q1 and Q2.
Returns true if a string matches a pattern, and false if it does not match a pattern.
Arguments
value
String. Table column name. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. Defines the string pattern to match. You must enclose the pattern in double quotation marks (" "). The match is case-sensitive. You can use the following special characters in a pattern:
A percent character (%) matches zero or more characters. As shown in the usage example below, %ace% matches any string value that contains the substring ace, such as Facebook, and MySpace. It does not match Ace Corporation because this string contains a capital A, and not the lowercase a.
An underscore character (_) matches exactly one character. For example, t_n matches tan, ten, tin, and ton. It does not match teen or tn.
To match a literal percent (%), underscore (_), precede those characters with two backslash (\\) characters. For example, to see if a string contains M_10, specify the following pattern:
"%M\\_10%"
Example
This example creates a computed column that displays whether a company name contains the string 'ace'.
var columnNameAfter = "PRODUCTCODE";
var columnName = "COMPANYNAME";
var columnLabel = "Like";
var category = "Comparison";
var categoryFunc = "LIKE";
var arguments = [{"value":"["+columnName+"]"},{"value":"%ace%"}];
Finds the numerical position of a substring in a string.
Arguments
value
String. Defines the string to find.
value
String. Table column name. Defines the string in which to search. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The starting position from which to start the search.
Example
This example creates a computed column that displays the location of the string 'Car' in the product line column.
Extracts a substring from a string, starting from the leftmost, or first, character.
Arguments
value
String. Table column name. Defines the string from which to extract a substring. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The number of characters to extract, starting from the first character. If the number is zero, the function returns an empty string. If the number is greater than the length of the string, the function returns the entire string.
Example
This example creates a computed column that displays the first 10 characters of the product line column.
var columnNameAfter = "PRODUCTCODE";
var columnName = "PRODUCTLINE";
var columnLabel = "LEFT";
var category = "Text";
var categoryFunc = "LEFT";
var arguments = [{"value":"["+columnName+"]"},{"value":"10"}];
String. Table column name. The string to convert to lowercase. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
Example
This example creates a computed column that displays the product line column value in lowercase.
Extracts a substring from a string, starting from the rightmost, or last character.
Arguments
value
String. Table column name. Defines the string from which to extract a substring. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The number of characters to extract, starting from the last character. If the number is zero, the function returns an empty string. If the number is greater than the length of the string, the function returns the entire string.
Example
This example creates a computed column that displays the last 5 characters of the product line column.
var columnNameAfter = "PRODUCTCODE";
var columnName = "PRODUCTLINE";
var columnLabel = "Right";
var category = "Text";
var categoryFunc = "RIGHT";
var arguments = [ {"value":"["+columnName+"]"},{"value":"5"}];
Finds the location of a substring in a string. The substring can contain wildcard characters.
Arguments
value
String. The string pattern to search for. You must enclose the pattern in quotation marks (" "). You can use the following special characters in a pattern:
An asterisk (*) matches zero or more characters, including spaces. For example, t*n matches tn, tin, and teen.
A question mark (?) matches exactly one character. For example, t?n matches tan, ten, tin, and ton. It does not match teen or tn.
value
String. Table column name. Defines the string in which to search. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
value
String. The starting position from which to start the search.
Example
This example creates a computed column that displays the location of a string matching the pattern 'a*Cars' in the product line column.
Removes the leading and trailing blank characters from a string.
Arguments
value
String. Table column name. The string from which to remove leading and trailing blank characters. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
Example
This example creates a computed column that displays the trimmed value of the product line column.
Removes the leading blank characters from a string.
Arguments
value
String. Table column name. The string from which to remove leading blank characters. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
Example
This example creates a computed column that displays the value of the product line column with no leading spaces.
Removes the trailing blank characters from a string.
Arguments
value
String. Table column name. The string from which to remove trailing blank characters. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
Example
This example creates a computed column that displays the value of the product line column with no trailing spaces.
String. Table column name. The string to convert to uppercase. The column name description follows the BIRT syntax convention. Use the following syntax:
value:[ColumnName]
Example
This example creates a computed column that displays the product line column value in uppercase.
Use show( ) to reveal a report Table, as shown in the following code:
myTable.show( );
showColumn
Syntax
void Table.showColumn(string columnName)
Shows the Table column by specifying the column name.
Parameter
enabled
String. The data binding name for the column to display.
Example
This example shows the PRODUCTLINE column in myTable:
function showMyColumn(myTable) {
myTable.showColumn("PRODUCTLINE");
myTable.submit( );
}
showDetail
Syntax
void Table.showDetail(string columnName)
Displays information for a column from the grouped data displayed on the page. If every column is hidden, only the group name is visible.
Parameter
columnName
String. The data binding name for the column to display.
Example
This example shows the information from the PRODUCTLINE column in the grouped data that is displayed for myTable:
function showMyDetail(myTable) {
myTable.showDetail("PRODUCTLINE");
myTable.submit( );
}
submit
Syntax
void Table.submit(function callback)
Submits all the asynchronous operations for this Table element. The submit( ) function triggers an AJAX request to submit all the asynchronous operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the table container.
Parameter
callback
Function. The function called after the asynchronous call processing finishes.
Example
This example clears existing filters from the PRODUCTLINE column and pops up an alert box: