Microsoft KB Archive/104052

= FIX: FoxPro Sends Only Two Decimals to MS Graph =

Article ID: 104052

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.6a Standard Edition

-



This article was previously published under Q104052



SYMPTOMS
FoxPro for Windows will only send data with a precision of two decimal places to Microsoft Graph. In other words, numeric fields that contain more than two decimal places will be rounded to just two places. The settings for the SET DECIMALS TO and SET FIXED commands have no effect on this behavior.



CAUSE
This behavior is caused by a limitation in the way that the GraphWizard sends data to MS Graph.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro for Windows version 3.0b.



MORE INFORMATION
The results of a query in the RQBE window can be sent to a graph by selecting Graph from the Output list box. The GraphWizard then takes over and provides direction on the creation of the graph/chart.

Steps to Reproduce Behavior
 Create a new database that has one character field and two numeric fields. The fields can have the default width of ten. However, make sure the numeric fields have three decimal places. Add three records to the database. In the character field, enter the letters A, B, and C. Enter any number for the numeric fields, as long as it has three decimal places. (NOTE: The third decimal place should not be zero.) In the Command window, issue the following command:

USE

 From the Run menu, choose New Query. In the Output list box, select Graph. Choose Do Query. The GraphWizard will take over and provide guidance on the creation of the chart. For purposes of reproducing this problem, choose Next three times. You should now be at the screen that says "Here's your graph!" Choose the Zoom button to open the graph in a window by itself. Double-click the graph to start up MS Graph.

When MS Graph is open, there will be two windows. The graph will be in a window in front and will say "FoxPro(####)-Chart" in the title bar. The window in the background will contain the datasheet and will say "FoxPro(####)-Datasheet" in the title bar.</li> Activate the Datasheet window. Select (highlight) the cells that contain numbers either by using the mouse or by using the arrow keys while holding down the SHIFT key.</li> From the Format menu, choose Number. In the Format box at the bottom of the dialog box, type "0.000" (without the quotation marks). This is a custom number format that will display three decimal places. Choose OK.</li></ol>

The datasheet for the graph will now display the numbers with three decimal places. Note that the third decimal place is always zero. The numbers have been rounded. You can manually enter additional decimal places in Graph, but they will not automatically transfer over from FoxPro due to the limitation in the GraphWizard.

<div class="references_section">