PRB: Report Writer Rounds Numeric Values

ID: Q128892

The information in this article applies to:

SYMPTOMS

The Report Writer rounds numeric values when the field on the report is physically smaller than the original size of the field.

CAUSE

When the field size is not too small (where the field cannot hold the size of the numeric value) but the field is not large enough to hold the complete value, the Report Writer rounds the value.

RESOLUTION

1. Increase the physical size of the field on the report.

2. Leave the field the original size created by the Report Writer, but

   reduce the font size when more space is needed horizontally.

3. Use the "TOP -- FIELD CAN STRETCH" option. This will cause the number to
   wrap to the next line.

STATUS

This behavior is by design.

MORE INFORMATION

In the Report Writer, if a field is too small to contain a given value, the field will contain asterisks to indicate numeric overflow. However, before this point is reached, you can decrease the size of the field and the Report Writer will round the number to fit it into the smaller field.

Steps to Reproduce Behavior

1. In FoxPro, create a new report.

2. In the Report Writer, Open the Customer table.

3. Add the ytdpurch field to the report, and set the font to Courier New,

   size 10)

4. Add a second ytdpurch field next to the first. Resize this field so that
   only "ytdpur" is displayed in the field box.

5. Add a third ytdpurch field next to the second. Resize this field so that
   only "ytd" is displayed in the field box.

6. Perform a Page Preview, and observe these results:

    - The original field displays the proper value from the Customer table.

    - Some of the values in the second field are rounded (all values in the
      thousands range).

    - Most of the values in the third field are asterisks (values in the
      thousands) with the remainder of the values rounded.

NOTE: If the second field has a "TOP--FIELD CAN STRETCH" attribute, you'll be able to see full value, but it will be wrapped.

Additional reference words: FoxWin 2.60a Report Writer round asterisk KBCategory: kbtool kbprb KBSubcategory: FxtoolRwriter

Last Reviewed: June 27, 1995