SetDetailHeight method (DataWindows)
Description
Sets the height of each row in the specified range to the specified value.
Controls
DataWindow type | Method applies to |
---|---|
PowerBuilder | DataWindow control, DataWindowChild object, DataStore object |
Web | Server component |
Web ActiveX | DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
integer dwcontrol.SetDetailHeight ( long startrow, long endrow , long height )
[Web DataWindow server component]
short dwcontrol.SetDetailHeight ( long startrow, long endrow, long height )
[Web ActiveX]
number dwcontrol.SetDetailHeight ( number startrow, number endrow, number height )
Argument | Description |
---|---|
dwcontrol | A reference to a DataWindow control or DataStore for which you want to set the height of one or more rows in the detail area |
startrow | The first row in the range of rows for which you want to set the height |
endrow | The last row in the range of rows for which you want to set the height |
height | The height of the detail area for the specified rows in the units specified for the DataWindow object |
Return Values
Returns 1 if it succeeds and –1 if an error occurs.
If any argument's value is null, in PowerBuilder and JavaScript the method returns null.
Usage
Call SetDetailHeight in a script to vary the amount of space assigned to rows in a DataWindow control or DataStore. You cannot specifically set the height for different rows when you define a DataWindow object in the DataWindow painter, although you can turn on the Autosize Height property for the detail band so that the height of each row is determined by the data.
You can set the detail height of one or more rows to zero, which hides them from view.
Examples
This statement sets the height of rows 2 and 3 to 500:
dw_1.SetDetailHeight(2, 3, 500)
This script retrieves rows for a DropDownDataWindow associated with the Company_Name column. It then hides rows 2 and 3 of the DropDownDataWindow by setting their detail height to 0:
DataWindowChild dwc;
integer rtncode;
rtncode = dw_1.GetChild("company_name", dwc)
IF rtncode < 0 THEN HALT
dwc.SetTransObject(SQLCA)
dwc.Retrieve( )
dwc.SetDetailHeight(2, 3, 0)
Expression DataWindow object property
Description
The expression for a computed field control in the DataWindow. The expression is made up of calculations and DataWindow expression functions. The DataWindow evaluates the expression to get the value it will display in the computed field.
Controls
Computed field controls
Syntax
PowerBuilder dot notation:
dw_control.Object.computename.Expression
Describe and Modify argument:
"computename.Expression { = 'string ' }"
Parameter | Description |
---|---|
computename | The name of the computed field control in the DataWindow for which you want to get or set the expression |
string | A string whose value is the expression for the computed field |
Usage
In the painter
Select the control and set the value in the Properties view, General tab, Expression option. The More button displays the Modify Expression dialog, which provides help in specifying the expression. The Verify button tests the expression.
Examples
setting = dw1.Object.comp_1.Expression
dw1.Object.comp_1.Expression = "avg(salary for all)"
setting = dw1.Describe("comp_1.Expression")
dw1.Modify("comp_1.Expression='avg(salary for all)'")