Contents   Index   Previous   Next



Script Expression Functions

 

ElementExists(Name: String): Boolean

Checks if a report element with the given name exists.

Example:

ElementExists('Label1')

SetBoolProp(ComponentName, PropertyName, PropertyValue)

Sets a boolean property for a component.

Example:

SetBoolProp('Childband1','Enabled',False)

SetBoolProp('MyShape','Enabled',True)

SetIntProp(ComponentName, PropertyName, PropertyValue)

Sets a numeric property for a component

Example:

SetIntProp('Band1',Height,200)

SetFloatProp(ComponentName, PropertyName, PropertyValue)

Sets a floating point property for a component

SetStrProp(ComponentName, PropertyName, PropertyValue)

Sets a string property for a component

Example: SetStrProp('Label1','Caption','This is a test')

GetBoolProp(ComponentName, PropertyName, PropertyValue): Boolean

Reads a boolean property from a component.

Example:

IF (GetBoolProp('DBText1','Enabled))

SetColor('DBText1',Black)

ENDIF

GetIntProp(ComponentName, PropertyName): Integer

Reads a numerical property from a component

Example: SETVAR('LastBandHeight',GetIntProp('DetailBand','Height'))

GetFloatProp(ComponentName, PropertyName): Float

Reads floating point property from a component

GetStrProp(ComponentName, PropertyName,): String

Reads a string property from a component

Example:

GetStrProp('Expr1','Caption')

OkBox(Text: String)

Shows a message dialog with the given text and an OK button

Example:

OkBox('Fasten your seat belts')

OkCancelBox(Text: String): Boolean

Shows a message dialog with the given text and both an OK button and a CANCEL button. Returns TRUE if the OK button has been pressed, FALSE otherwise.

Example:

IF (OkCancelBox('Print now?'))

Return(True)

ELSE

Return(False)

ENDIF

YesNoBox(Text: String): Boolean

Same as "OkCancelBox" but with "Yes" and "No" buttons.

InputBox(Title, Text, VariableName): Boolean

Shows an input dialog. The user must type in a value that is stored in the given variable.

Example:

InputBox('Input start date','Start date:','VDate')

SetColor(Name, Color)

Sets the (background) color of the given report element. The color parameter is a numerical value (same as in Delphi), but the following constants are available: Black, Maroon, Green, Olive, Navy, Purple, Teal, Gray, Silver, Red, Lime, Blue, Fuchsia, Aqua, White. You can also use the RGBCOLOR function (see below).

Example:

SetColor('Childband2',Yellow)

SetColor('Childband2',87123)

SetColor('Childband2', RGBColor(255,0,128))

RGBColor(Red, Green, Blue): Integer

This function creates a color value for use with SETCOLOR and SETFONTCOLOR from red, green and blue parts.

Example:

RGBColor(64,0,0) (is a dark red color)

SetFont(ComponentName, FontName)

Sets the font for a given component

Example:

SetFont('Label1','Arial')

SetFontColor(ComponentName, Color)

Sets the font color for a given component. Please see the description of SETCOLOR above.

SetFontSize(ComponentName, Fontsize)

Sets the font size for a given component

Example:

SetFontSize('TitleLabel',24)

SetFontStyle(ComponentName, IsBold, IsItalic, IsUnderline, IsStrikeout)

Sets the font style (bold, italic, underline and strikeout) for a given component. Each style is a boolean parameter that must be set to TRUE for activating it.

Example: SetFontStyle(DBText1,true,false,false,false)