GetItemFormattedString

Description

Gets and formats data whose type is String from the specified buffer of a DataWindow control or DataStore object.

NoteSeparate method names for the Web DataWindow server component Separate method names, GetItemFormattedStringByColNum, GetItemFormattedStringByColNumEx, and GetItemFormattedStringEx, are provided as alternative syntaxes for the Web DataWindow server component, which cannot use overloaded methods.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object

Web

Server component

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

PowerBuilder

string dwcontrol.GetItemFormattedString ( long row, integer column 
	{, DWBuffer dwbuffer, boolean originalvalue } )
string dwcontrol.GetItemFormattedString ( long row, string column 
	{, DWBuffer dwbuffer, boolean originalvalue } )

Web DataWindow server component

string dwcontrol.GetItemFormattedString ( long row, string column )
string dwcontrol.GetItemFormattedStringByColNum ( long row, 
	short column )
string dwcontrol.GetItemFormattedStringByColNumEx ( long row,
	short column, string dwbuffer, boolean originalvalue )
string dwcontrol.GetItemFormattedStringEx ( long row, string column,
	string dwbuffer, boolean originalvalue )

Web ActiveX

string dwcontrol.GetItemFormattedString (number row, 
	number column, number dwbuffer, boolean originalvalue )
string dwcontrol.GetItemFormattedString ( number row, 
	string column, number dwbuffer, boolean originalvalue )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow.

row

A value identifying the row location of the string data.

column

The column location of the data. The datatype of the column must be String. Column can be a column number or a column name. The column number is the number of the column as it is listed in the Column Specification view of the DataWindow painter—not necessarily the number of the column in the Design view.

To get the contents of a computed field, specify the name of the computed field for column. Computed fields do not have numbers.

dwbuffer (optional)

A value of the dwBuffer enumerated datatype (PowerBuilder) or an integer (Web ActiveX) or a string (Web DataWindow) identifying the DataWindow buffer from which you want to get the data. For a list of valid values, see DWBuffer.

originalvalue (optional)

A boolean indicating whether you want the original or current values for row and column:

  • True – Returns the original values (the values initially retrieved from the database).

  • False – (Default) Returns the current values.

If you specify dwbuffer, you must also specify originalvalue.

Usage

Use GetItemFormattedString in place of GetItemString when you want to return the value from a column in its current display format. This is especially useful if the column in question is not a computed column.

Examples

Example 1

These statements set LName to the current string in the primary buffer for row 3 of in the column named emp_name in the DataWindow dw_employee. The retrieved value is formatted with the display format of the column:

String LName

LName = dw_employee.GetItemFormattedString(3, "emp_name")

See also