<< Return to Main Index

< Return to Class Index

CGXFormulaSheet Class Members

Construction

CGXFormulaSheet Constructs a CGXFormulaSheet object and establishes a connection to the formula engine..

Operations

operator= Copies all cells, named ranges and worksheet settings from one formula worksheet to another formula worksheet.
Serialize Serializes all cell data and formula worksheet settings.
DeleteContents Deletes all cells.
InitParam Called from CGXGridCore::OnGridInitialUpdate to initialize some default parameter settings.
RegisterBaseStyles Registers base styles (e.g. for constraint violations).

Cell Values

SetFormulaRowCol Assigns a formula expression to a cell. The formula must start with an equal sign ('=").
SetTextRowCol Assigns a text label to a cell.
GetTextRowCol Returns the text value for a cell. Numeric values will be converted to strings. Formulas will be reevaluated if necessary. Cells with error state will return "Error!" as text.
SetNumberRowCol Assigns a number to a cell.
GetNumberRowCol Returns the numeric value for a cell. Text label will return 0. Formula will be reevaluated if necessary.
SetFormatRowCol Changes the numeric formatting of a cell.
GetFormatRowCol Returns the numeric formatting to a cell.
SetExpressionRowCol Parses the given text and based on the text content assigns a formula, a text label or a number to the specified cell. To force numeric or date values to be stored as string, insert an apostrophe ("'")  at the beginning of the text. Formulas must start with an equal sign ('=').
GetExpressionRowCol Returns either the text value or formula for the cell. Numeric values will be converted to a string. Text label cells will have a leading apostrophe ("'") to identify them as string.
GetUpdateFlag Checks if the given cell needs to be redrawn (e.g. if formula result has been changed). CGXGridCore::RefreshViews checks GetUpdateFlag for all visible and refreshes them if GetUpdateFlag returns TRUE.
SetUpdateFlag Forces the given cell to be redrawn with the next RefreshViews() call.

Row and column coordinates

GetEngineRow Converts a grid row coordinate (of type ROWCOL, zero-based) into a engine row coordinate (of type int, zero-based).
GetEngineCol Converts a grid column coordinate (of type ROWCOL, zero-based) into a engine column coordinate (of type int, one-based).
GetGridRow Converts a engine row coordinate (of type int, zero-based) into a grid row coordinate (of type ROWCOL, zero-based).
GetGridCol Converts a engine column coordinate (of type int, one-based) into a grid column coordinate (of type ROWCOL, zero-based).

Sheet Settings

SetIterationLimit When the Iteration Limit is set to a non-zero value, iterative calculation is enabled. In this mode, Objective Grid will make multiple recalculation passes, still preserving the natural order and minimal recalculation rules, until either the iteration limit has been reached or, if constraint checking is enabled, until all constraints are satisfied, whichever comes first.
GetIterationLimit Returns the Iteration Limit value.
SetBlanksAreZeros Specified if blank cells should be treated as a numeric 0 in formula expressions.
GetBlanksAreZeros Returns TRUE if blank cells should be treated as a numeric 0 in formula expressions.
SetRecalcMode Objective Grid lets you decide whether or not to recalculate the spreadsheet after you make changes that affect other cells or whenever the sheet is initially loaded. Objective Grid automatically recalculates the spreadsheets in both cases if Recalculation Mode is set to Automatic. If recalculation is occupying too much time, you can turn automatic recalculation off. Objective Grid will only recalculate upon explicit request.
GetRecalcMode Returns the recalculation mode setting.
SetRecalcMethod Recalculation Method defines how Objective Grid will proceed with recalculation. There are two options: As Needed and Foreground. As Needed means that recalculation is highly optimized to recompute the minimum number of cells when updating the sheet. This can result in significant performance improvement for certain types of sheets, particularly on very large sheets.
GetRecalcMethod Returns the recalculation method setting.
SetConstraintCheck Toggles on/off constraint checking. Constraints are limitations or conditions placed on the variables in your spreadsheet. They are expressed as algebraic statements appended to formulas. You can attach a constraint expression to any formula, by typing a semicolon (;) and the constraint conditions after the formula.
GetConstraintCheck Returns TRUE if constraint checking is enabled.

Recalculation

AddRecalcRange Marks a give range of cells so that formula cells that depend on the marked cells will later be reevaluated. The formula engine maintains a recalculation range list where all these ranges are added.
Recalc Recalculates all cells in the worksheet that depend on cells in the recalculation range list.
ResetError Resets the error state of the formula engine.
GetError Returns the error state of the formula engine. Objective Grid will call this method and if necessary display a message box with error information based on the return value of this GetError method.

Named Ranges

SetRangeName Adds a named range or replaces an existing named range with the new range settings.
GetRangeName Returns the associated range for a given range name.
DeleteRangeName Deletes a named range from the range name list.
GetRangeNameArray Returns a string array with all named ranges. Each entry in the array is in the form 'name=A1..B5'
SetRangeNameArray Add a batch of named ranges from a string array. Each entry in the array is in the form 'name=A1..B5'

Range Specification

TextToRange Converts a range specification, e.g. 'A1..C5' into a CGXRange object, e.g. CGXRange(1,1,5,3).
RangeToText Converts a CGXRange object, e.g. CGXRange(1,1,5,3) into a range specification, e.g. 'A1..C5'.

Expression Evaluation

EvaluateExpression Parses and evaluates the given expression and returns the result as string.
ParseExpression Parses the given expression and returns the parsed formula expression in binary format.

Clipboard Cut, Copy/Paste

StoreCopyCells Copies cells from a given source range to a new destination. Cell references in formula expressions (unless marked as absolute range) will be adjusted.
StoreMoveCells Moves cells from a given source range to a new destination. Cell references in formula expressions that depend on cells in the moved range will be adjusted.

Cell Operations

GetColCount Returns the number of columns.
GetRowCount Returns the number of rows.
StoreColCount Specifies the number of columns.
StoreRowCount Specifies the number of rows.
GetStyleRowCol Looks up a style in the formula engine. If called with nType = GX_VALUE_EXPRESSION the formula expression (if available) will be assigned to the style value. Otherwise the evaluated cell value (the result) will be assigned to the cell value.
StoreStyleRowCol Stores a style into the formula engine. If called with nType = GX_VALUE_EXPRESSION the style value will be parsed (by calling SetExpressionRowCol). Otherwise the style value will be assigned to the cell as text label (by calling SetTextRowCol).
StoreInsertCols Inserts columns in the formula engine and updates cell references to moved cells.
StoreInsertRows Inserts rows in the formula engine and updates cell references to moved cells.
StoreMoveCols Moves columns in the formula engine and updates cell references to moved cells.
StoreMoveRows Moves rows in the formula engine and updates cell references to moved cells.
StoreRemoveCols Removes columns in the formula engine and updates cell references to moved cells.
StoreRemoveRows Removes rows in the formula engine and updates cell references to moved cells.
StoreMoveDataCols Rearranges the columns in the grid. The new order of columns is specified through the awColIndex array. Cell references to moved cells will be updated.
StoreMoveDataRows Rearranges the rows in the grid. The new order of rows is specified through the awRowIndex array. Cell references to moved cells will be updated.

CGXFormulaSheet

Class Overview