Microsoft KB Archive/99629

= Values that are returned by UDFs cannot be centered in a report =

Article ID: 99629

Article Last Modified on 2/11/2005

-

APPLIES TO


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

-



This article was previously published under Q99629



SUMMARY
A user-defined function (UDF) can be used to return values to a report in FoxPro for Windows. A UDF function call is implemented in a report as a field expression. Because it is a field expression, the function call can be formatted using normal formatting procedures. However, a UDF call cannot be centered within a field in a report created with the Report Writer in FoxPro for Windows unless you choose Text Alignment, then Center, from the Object menu.



Steps to Reproduce Problem
A UDF function call can appear as a field expression within a report. However, the results returned by the function call cannot be centered like field expressions can. For example, do the following:  Use the INVOICES database in the TUTORIAL subdirectory of FoxPro for Windows. Create a quick report based on this database. Place a 25-character-wide field within the report with the UDF call TEST as the field expression. Under FORMAT for the field choose CENTER from the Editing options. Save and close the report. Create a program called TEST in this same directory. The only line in this program will be:

RETURN &quot;HELLO WORLD!&quot;

 Now print or preview the report.

The field will be left-justified within the field expression even though the Center format was chosen.</li></ol>

To center this UDF call within the report, do the following:
 * 1) Select the UDF expression within the report.
 * 2) From the Object menu, choose Text Alignment, then choose Center.

When the report is printed or previewed, the UDF return value will be centered within the field expression instead of being left-justified.

Additional query words: VFoxWin FoxWin 2.50 CENTER UDF RWriter

Keywords: KB99629

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.