Microsoft KB Archive/160594

= HOWTO: Use Report File Units =

Article ID: 160594

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q160594



SUMMARY
In creating a report programmatically, you can use the following formula to determine the width for objects on the report:

625/6 report units per pixel



MORE INFORMATION
The FONTMETRIC function returns return various attributes of a specified font. For example, FONTMETRIC(6) returns the average character width in pixels of the current font.

So, to calculate the average width needed in a report for a five-character field, you could use the following formula: reportwidth = 625/6 * ; (FONTMETRIC(6, , , ) * ;     nNumCharacters) nNumCharacters specifies the number of characters for which you need to allow room.

The following line of code would store the average width needed in a report for a five-character field in the font "Times New Roman," size 12, style Normal. reportwidth = 625/6 * (FONTMETRIC(6, "Times New Roman", 12, "N") * 5)

