Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic font size
Message
From
25/08/2010 04:16:38
Sharath Shetty
Sri Krishna Consultancy Services
Mumbai, India
 
 
To
23/08/2010 16:57:20
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01477561
Message ID:
01478308
Views:
77
>>>Hi All:
>>>
>>>A while ago, Tamar Granor helped me with writing a report using the following listener:
>>>
>>>
>>>loListener = NEWOBJECT("EffectsListener",HOME(2) + "\Solution\Europa\DynamicFormatting.prg")
>>>
>>>
>>>Upon further study, it seems that this program only handles the ability to dynamically change font style (bold, italics, etc) and font color. For each of these items, there is a method in the above program. Following are short snippets of each:
>>>
>>>
>>>define class DynamicForeColorEffect as UserEffectHandler
>>>	cEffectName = 'FORECOLOR'
>>>
>>>* Evaluate the expression. If the result is a numeric value and doesn't match
>>>* the existing color of the object, change the object's color and set the
>>>* Reload flag to .T.
>>>
>>>	function Execute(toObjProperties, tcExpression)
>>>		local lnColor, ;
>>>			lnPenRed, ;
>>>			lnPenGreen, ;
>>>			lnPenBlue
>>>		lnColor = This.EvaluateExpression(tcExpression)
>>>
>>>
>>>
>>>define class DynamicStyleEffect as UserEffectHandler
>>>	cEffectName = 'STYLE'
>>>
>>>* Evaluate the expression. If the result is a numeric value and doesn't match
>>>* the existing style of the object, change the object's style and set the
>>>* Reload flag to .T.
>>>
>>>	function Execute(toObjProperties, tcExpression)
>>>		local lnStyle
>>>		lnStyle = This.EvaluateExpression(tcExpression)
>>>
>>>
>>>I need a method to dymnamically change FONT SIZE and the FONT NAME.
>>>
>>>How do I accomplish that?
>>>
>>
>>Take look at www.report-sculptor.com
>>You create report using forms and form objects. You build report bands (visually) as form containers and then drive whole
>>report directly from your code. You already know how to manipulate form objects at run time, therefore everything in your report (be that entire columns, fonts, colors, sizes, pictures, etc) is dynamic.
>>
>>HTH
>>Sergio
>
>Thanks, Sergio; I will look at it.

Hi Yossi

here is a sample how to change font & size dynamically
http://blog.donnael.com/2004/06/vfp9-report-sample/

oObjProperties.FontSize = 12


as said by Doug Hennig

>>You have to size the field large enough to display the largest text.

still applicable
Previous
Reply
Map
View

Click here to load this message in the networking platform