Consultor Eletrônico



Kbase 19716: Specific Format Needed for Negative values output to Excel
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/04/2000
Negative Numbers OUTPUT TO an .xls file should be formatted with the minus sign in the left-most position.

If the minus sign follows the digits, Excel will not interpret a negative decimal or integer field as a number; the spreadsheet will treat those negative values as text values.

After setting a few customer.balance values to negative numbers, the following code can be run to observe this behavior.

OUTPUT TO c:\temp\Testfile.xls.
FOR EACH customer NO-LOCK:
PUT customer.name CHR(9)
customer.balance format ">>>,>>9.99-" SKIP.
END.
OUTPUT CLOSE.

Changing the format to "->>>,>>9.99" corrects the problem so that the resulting spreadsheet data has a consistent data type for the balance information.