Controls in a DataWindow

Large Binary/Text database OLE object

Description

The Large Binary/Text database OLE object for DataWindow is unsupported.

Workaround

This workaround only applies to the BitMap OLE object.

If a column with any large Binary/Text Database OLE object is used for displaying graphs, do the following steps to work around this issue:

Step 1: Replace the column with a Graph control.

Step 2: Retrieve the content of the column in the table related with the DataWindow using a SELECTBLOB SQL statement.

Step 3: Call the SetPicture function of this Graph control.

Column control

Char data type column

Description

When you set the data type of a column as char with a specified length, the value of the column data type retrieved by Appeon is different from that in PowerBuilder. The value you get in Appeon is char, but the value you get in PowerBuilder is char(n).

Workaround

Add one more condition while using the returned value.

Example

The original script:

string ls_datatype
ls_datatype = dw_1.object.group_id.coltype
if(ls_datatype = “char(50)”) then
  ...
else
  ...
end if

Add one more conditional statement, as shown in the following modified script.

The modified script:

string ls_datatype
ls_datatype = dw_1.object.group_id.coltype
if(ls_datatype = “char(50)” or ls_datatype = "char") then 
  ...
else
  ...
end if
Evaluating DataWindow expressions in scripts

Description

When using global functions in DataWindow expressions to dynamically change the attributes of DataWindow objects at run time, this method does not work well with an Appeon application, for the DataWindow expressions are only evaluated once.

Workaround

Modify a computed expression on the DataWindow in order to force the expression to re-evaluate.

Note: Generally speaking, DataWindow expressions will slow-down the initial display or subsequent refresh of DataWndows. As such, Appeon recommend you reduce the usage of DataWindow expressions if possible, especially in the following situations:

  • Avoid using DataWindow expressions for computing and setting column properties.

  • Avoid setting sort and filter criteria directly for a DataWindow object. Instead, write the sort and filter criteria in the SQL statement of the DataWindow object. As noted previously, it is faster to use SQL statements than DataWindow functionality.

Example

An expression like this will not re-evaluate itself: Expression: f_color()

After making a change that would cause f_color() to return a different value (i.e. selecting a different preferred color from a drop-down), the application has to slightly change the size of the DataWindow in order to force the expression to re-evaluate.

The modified script:

integer li_dw_width, li_dw_height
li_dw_width=dw_1.width
li_dw_height=dw_1.height
    
dw_1.width=li_dw_width-4         // Squeeze the DW
dw_1.height=li_dw_height-4
    
dw_1.width=li_dw_width         // Restore to original size
dw_1.height=li_dw_heigh