QScript CalculationGridCell

From Q
Jump to navigation Jump to search

CalculationGridCell

The cell that is part of a Calculation Grid.

Cells are automatically created by a Calculation Grid. You can access them using cell() in a Calculation Grid.

code

The R code which gets executed.

columnIndex

The column index within the Calculation Grid, matching the column passed to cell(). The row-header column is index 0.

data

An interface that enables the querying of a Calculation's data. Causes re-calculation.

decimalPlaces

The decimal places shown for this cell. If this is null, this cell uses the Calculation Grid's value. Setting this only affects this cell.

equals(obj)

Whether two objects are the same.
objThe object to compare against.
Returns:true or false
Example:
data_file.getQuestionByName('Q2').equals(data_file.questions()[0])

error

Errors with the R code or found in the execution of the R code. Returns null if there is no error. Causes re-calculation.

messages

Messages produced in the execution of the R code. Returns null if there are no messages. Causes re-calculation.

name

Get/set the name for this object, as it appears in the Report.

numberFormat

The number format shown for this cell. If this is null, this cell uses the Calculation Grid's format. Setting this only affects this cell.

outputClasses

Returns an array of strings, which are the R classes of the output of this R calculation. The calculation is evaluated automatically if needed. If the calculation is in error, an exception is thrown.

rowIndex

The row index within the Calculation Grid, matching the row passed to cell(). The column-header row is index 0.

text

Textual output of the R code. Returns null if the item has not produced text output, or perhaps is in error. Causes re-calculation.

type

Returns "Calculation Grid Cell".

warning

Warning messages produced in the execution of the R code. Returns null if there is no warning. Causes re-calculation.