ReportBox.OnChangeCellContent

Syntax

Sub ReportBoxOnChangeCellContent(Sender: Object; Args: IReportCellContentChangeEventArgs);

Begin

//set of operators

End Sub ReporBox1OnChangeCellContent;

Parameters

Sender. A parameter that determines the component where the event occurred.

Args. The parameter that enables the user to determine the cell where the change took place and to set additional parameters.

Description

The OnChangeCellContent event occurs if a table cell contents has been changed. Handling this event can be used, for example, to get the formulas entered by the user.

This event differs from the ReportBox.OnCellChange event as follows: the ReportBox.OnCellChange event occurs only when value of a table cell is modified, while the OnChangeCellContent event occurs when value, text or formula of a table cell is changed.

For example, the table cell has the 5 value. If a formula =3+2 is entered to this cell, the value and text remain the same, and only a formula will have changed. Therefore, the ReportBox.OnCellChange event does not occur, but the OnChangeCellContent event occurs as the cell contents has been changed but the value remains the same.

If a formula was entered or changed in the cell and cell value was changed, the OnChangeCellContent event will be called twice: before and after the ReportBox.OnCellChange event. First time the Value property of the Args parameter is called, it contains the entered formula, when the Value property is called for the second time it contains formula result.

Example

To execute the example you need to set this procedure as the event handler for the OnChangeCellContent event (changing content of a table cell) for the ReportBox component with the ReportBox1 identifier.

Sub ReportBox1OnChangeCellContent(Sender: Object; Args: IReportCellContentChangeEventArgs);

Begin

If Args.Type = TabCellContentChange.Formula Then

WinApplication.InformationBox("A formula has been entered: " + Args.Value);

End If;

If Args.Type = TabCellContentChange.Value Then

WinApplication.InformationBox("Formula calculation result: " + Args.Value);

End If;

End Sub ReportBox1OnChangeCellContent;

If on entering a formula into the cell, the value in the cell changed, 2 messages will be displayed: with the formula text, and with its calculation result.

See also:

ReportBox