PB DataWindow SetDetailHeight method (DataWindows)

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)'")

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值