Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Conditionally change the font size Post Reply Post New Topic
Author Message
PRASAD SJ
Newbie
Newbie


Joined: 13 May 2009
Location: India
Online Status: Offline
Posts: 5
Quote PRASAD SJ Replybullet Topic: Conditionally change the font size
     Posted: 13 May 2009 at 4:00am
Dear friends,
 
How can I conditionally change the font size programatically by using a formulae based on another variable.
 
for example if the variable length is 10 then font size = 180
                   if the variable length is 20 then font size = 90 like that
 
thanks in advance,
 
regards,
 
prasad sj
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 May 2009 at 6:45am
right click on the field.  select the font tab. click the 'x-2' button then put the formula in.
maybe something like:
if len({table.field})=10 then
 180
else
 if len({table.field})=20 then
  90
 
haven't actually tried this, but I see no reason that it wouldn't work.
 
If the field is a text box, then this won't work...so make it a formula and you can use the above solution.
IP IP Logged
JohnT
Groupie
Groupie
Avatar

Joined: 20 Jan 2008
Online Status: Offline
Posts: 92
Quote JohnT Replybullet Posted: 13 May 2009 at 6:47am

In design mode, right click on the field you want to format.  Click on format field.  Click on the font tab.  Click on the x-2 box for font size.  Enter a formula like

If (condition) then 10 else 12
 
If the contition is true, the font size is set to 10 else it is set to 12.
 
IP IP Logged
giocar
Newbie
Newbie


Joined: 15 Nov 2010
Online Status: Offline
Posts: 1
Quote giocar Replybullet Posted: 24 May 2012 at 6:15am
Originally posted by JohnT

In design mode, right click on the field you want to format.  Click on format field.  Click on the font tab.  Click on the x-2 box for font size.  Enter a formula like

If (condition) then 10 else 12
 
If the contition is true, the font size is set to 10 else it is set to 12.
 
Clap
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum