Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CalculateDocumentVariableEventArgs Class

Contains data for the CalculateDocumentVariable event.

#Declaration

TypeScript
export class CalculateDocumentVariableEventArgs extends EventArgs

#Remarks

The CalculateDocumentVariable event occurs when a DOCVARIABLE field is updated. The event handler receives an argument of the CalculateDocumentVariableEventArgs type. The argument’s properties provide information specific to this event.

#Inheritance

EventArgs
CalculateDocumentVariableEventArgs

#Properties

#args Property

Provide access to arguments within the DOCVARIABLE field.

#Declaration

TypeScript
args: string[]

#Property Value

Type Description
string[]

An array containing DOCVARIABLE field arguments.

#fieldInterval Property

Returns the text buffer interval that contains the field.

#Declaration

TypeScript
readonly fieldInterval: Interval

#Property Value

Type Description
Interval

The text buffer interval.

#Remarks

options.events.calculateDocumentVariable = (s, e) => {
    if(e.variableName == 'sectionIndex')
        e.value = (rich.document.sections.find(e.fieldInterval.start).index + 1).toString();
};

#keepLastParagraph Property

Specifies whether the last paragraph mark of the inserted document is kept in the resulting document.

#Declaration

TypeScript
keepLastParagraph: boolean

#Property Value

Type Description
boolean

true, to retain the last paragraph mark of the inserted document; otherwise, false.

#Remarks

The keepLastParagraph property is in effect when the value property is set to an instance of the DocumentProcessorBase class.

Set the keepLastParagraph property to true to add the last paragraph mark of the inserted document to the resulting document.

#value Property

Specifies the result of the DOCVARIABLE field that fired the event.

#Declaration

TypeScript
value: null | string | DocumentProcessorBase

#Property Value

Type Description
string

A string that is the field result. null if the field has no result.

DocumentProcessorBase

An object that allows you to insert complex content as a field result.

#variableName Property

Gets the name of the document variable to which the DOCVARIABLE field refers.

#Declaration

TypeScript
variableName: string

#Property Value

Type Description
string

The name of the document variable.

#Remarks

The variableName property enables you to identify a document variable for which the event is fired.