Report Functions


Report functions are used to perform calculations on reports and other special tasks. Functions supported by CAPITAL GL Controller include:

 

@add()

Add an account balance, a numeric value or a report variable to another account balance, numeric value or report variable.

@subtract()

Subtract an account balance, a numeric value or a report variable from another account balance, numeric value or report variable.

@divide()

Divide the first account balance, numeric value or a report variable into another account balance, numeric value or report variable. Division by zero will print an error on the report.

@proportion()

Based on the first value, show the second value as a percentage proportion of the first value. This function is useful when you wish to display percentage increases or decreases of periods across months or years.

@multiply()

The same as above, except multiplication. The first value is multiplied by the other.

@percent()

Display the result of the first value as a percentage of the second.

@request()

Force new page if lines unavailable.

Examples will help illustrate the use of these functions:

@add(10,10)

@subtract([period_amt:10000], [period_amt-1:10000])

@multiply([period_amt:10000], 2)

The first function, the @add simply adds 10 to 10. The result printed on the report is 20. The second command, the @subtract, looks up the period activity for account 10000, then subtracts this from the period activity of 10000 for the prior period. This is the point of the '-1' code placed in the instruction [period_amt-1:10000].

Observe also that round brackets are used to surround the values to calculate, and each value is separated by a comma. The format of a function is:

@function(value1, value2)

Where value1 can be an account reference surround by square brackets [ ], a number, or a report variable. Report variables are discussed in the next section.

The third instruction, @multiply([period_amt:10000], 2)multiplies the period activity for account 10000 by 2.

The function @percent()reequires further explanation. The first value specified is the percentage portion of the second value specified. For example, the instruction @percent(50,100) would print 50 since 50 is 50 percent of 100. Likewise, the instruction @percent(20,200) would print 10, since 20 is 10 percent of 200.

The function @request() only accepts one value. This is the number of lines that must still be available on the report before printing of the section to follow will commence. This is useful if you want to ensure that a particular section, such as a series of sub-totals plus a total, all end up on the same page. For example, when the function @request(6) is found inside a report, CAPITAL determines if six lines on the current page (not counting the #footer section or bottom margin) is still available. If this is so, nothing is done. If this is not the case, CAPITAL ejects the current page and positions the printer to start at the top of the next page.

_______________________

Related Topics:

The Report Writer/Editor



Contents