Sybase 2 Barcode Reader User Manual


 
CHAPTER 7 Working with Controls in DataWindow Objects
DataWindow Designer User’s Guide 207
In this scenario, if the user changes the price of a part in the DataWindow
object, the cost changes immediately.
Recommendation
If you want your DBMS to do the calculations on the server before bringing
data down and you do not need the computed values to be updated dynamically,
define the computed column as part of the
SELECT statement.
If you need computed values to change dynamically, define computed fields in
the DataWindow painter Design view, as described next.
Defining a computed field in the DataWindow painter Design view
To define a computed field in the DataWindow painter Design view:
1 Select Insert>Control>Computed Field from the menu bar.
2 Click where you want to place the computed field.
If the calculation is to be based on column data that changes for each row,
make sure you place the computed field in the detail band.
The Modify Expression dialog box displays, listing:
DataWindow expression functions you can use in the computed field
The columns in the DataWindow object
Operators and parentheses
3 Enter the expression that defines the computed field as described in
"Entering the expression" next.
4 (Optional) Click Verify to test the expression.
DataWindow Designer analyzes the expression.
5 Click OK.
Entering the
expression
You can enter any valid DataWindow expression when defining a computed
field. You can paste operators, columns, and DataWindow expression
functions into the expression from information in the Modify Expression
dialog box. Use the + operator to concatenate strings.
Part # Quantity Price Cost
101 100 2.50 250.00