General information
Category:
Reports & Report designer
>>>I need a way of determining the width of text in a VFP 5.0 report. I'm generating a report FRX;FRT file on the fly and I have to determine the maximum amount of text I can put into a text box in the report. I'm currently using TXTWIDTH() and passing it the string to be printed as well as the Font information of the textbox being created. This method works OK in text boxes in forms but doesn't work when making reports.
>>>
>>>HELP !
>>>
>>>Thanks in advance ..
>>
>>As far as I know VFP Report Writer is not object-oriented, i.e. report controls don't have 'Width' property and TXTWIDTH() cannot be used here.
>
>True, However, the 'text box' control does have a physical width in which the text will be placed and wrapped around where appropriate. Foxpro obviously uses some algorithm to determine the size of the text - it has to be based on the Font being used - and this is the algorithm I need.
>
>Thanks in advance ..
Rob, what you need is to covert Pixel information to Report coordinates, right ?
To do this in VFP, multiply the top, left, width, or height by 104.17
i.e. nTxtWidthInRpt = nTextWidth * 104.17
You will have the width of the text for the FRX file.
The nTextWidth can be obtained via TXTWIDTH().
(Remember that TXTWIDTH() uses the character average width.)
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only