Consultor Eletrônico



Kbase 17651: Apptivity: Display calculated database fields in grid
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
Apptivity: Display calculated database fields in grid

This K-base describes how to get a Data-Bound grid that has an extra
column with a calculation from other database columns.
Ex:
The table has 2 fields A and B. The idea is to have a grid with 3
columns, A, B and A * B.
A solution to this problem is the following:
Use the Application Wizard to create a single data source application.
When arriving to the query-building part, make sure that the query has
the following structure:

SELECT TABELA, TABEL.B, TABEL.A * TABEL.B from TABEL

This will give you a result-set of three columns and binding the third
column to the third column in the grid will give you the desired
results.

If the user is able to modify fields A and B in the grid, the value
of the A*B column will not be updated by default. To accomplish this
behavior, there is an option on the property sheet of the DataSource
(Options Tag) that indicates: Force Requery on change.

TBO: 02/04/98

Progress Software Technical Support Note # 17651