Consultor Eletrônico



Kbase P105725: Is it possible to export a smartDataObject calculated field to Excel? 
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   24/04/2006
Status: Unverified

GOAL:

Is it possible to export a smartDataObject calculated field to Excel?

GOAL:

How to export a calculated field to Excel?

FIX:

There isn't any simple method provided to directly export a calculated field from a smartDataObject to Excel, but it can be done with 4GL. Solution P20080 documents how to export data to excel from an SDO using an Active X object. This code can be modified to export a calculated field to Excel even though it cannot be taken from the SDO itself. However, it means duplicating the SDO calculation with 4GL code.
The way to do this is to define a function or procedure that performs the calculation with suitable input and output parameters. Then as each table and field value is read (The REPEAT loop on NUM-ENTRIES(cFields)) writing data to the Excel sheet, the necessary field values for the calculation should be saved in local variables. When all the required values have been collected, call he function/procedure to perform the calculation. The resulting value can then be added to the Excel sheet as a column at the end of the current row.