Microsoft KB Archive/114135

= How to print an "X" instead of a "Y/N" for a logical field in a report in FoxPro =

Article ID: 114135

Article Last Modified on 2/18/2005

-

APPLIES TO


 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.6 Standard Edition
 * Microsoft FoxPro 2.5b for Macintosh
 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual FoxPro 7.0 Professional Edition
 * Microsoft Visual FoxPro 8.0 Professional Edition
 * Microsoft Visual FoxPro 9.0 Professional Edition

-



This article was previously published under Q114135



SUMMARY
Logical fields can be represented on reports as check boxes in FoxPro for Windows and FoxPro for Macintosh.



MORE INFORMATION
If a logical field is simply placed in a report, the value .F. or .T. is printed. To improve the appearance of your report, you can enter the picture "Y" in the Format box in the Report Expression dialog box. This will cause all false values to print as N, while all true values will print as Y.

While this technique is definitely sufficient and has been available since FoxBASE, FoxPro for Windows, FoxPro for Macintosh, and Visual FoxPro offer a graphical solution that may be more visually attractive. Instead of using Y and N, check boxes are used on screens to indicate individual choices that are either turned on or off. In the case of the report, the field label indicates the choice and the check box for each record either contains an X to indicate that the particular option was selected or is blank to show that the option was not selected.

To Create This Effect in the Report Writer
 Use the Box tool to place a small box at the appropriate location.  Use the Field tool to place a field on the report, and then enter and save the following expression in the Expression box: IIF(.T.,"X","") Note In Visual FoxPro 9.0, use the logical field name instead of .T. in the previous expression to prevent an error in the Expression Builder dialog box. If you do this, you do not have to do step 6 in Visual FoxPro 9.0.  From the Object menu, choose Font, and then choose Arial, 12, and Bold. Drag the field over the center of the small box. Ideally, the field should extend slightly above and below the box equally, but the box should extend equally to the left and right of the field. Resize the box as needed to produce this effect. Press CTRL+I or choose Preview from the Report menu, and verify that the X is centered in the box. If not, close the preview, select the field, and use the arrow keys to reposition the field until it is centered exactly. Once the X is properly positioned, open the Report Expression dialog box, and replace the .T. in the expression with the name of the logical field in the table.</ol>

Additional query words: VFoxWin FoxMac FoxWin 2.50 graphic extended characters RWriter Report Designer

Keywords: KB114135

-

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

© Microsoft Corporation. All rights reserved.