01 May | How Do I Dynamically Change the Font Size of a Field in Crystal Reports? | |
During a recent Crystal Reports 2008 training session a delegate explained that due to the fields having varying sizes there was a need to change the font size based on the length of the data of the field.
Solution:
The only way to change the font size of the field, is to apply a conditional format to the field based on the length of the data of the field.
To change dymically the font size of a field:
- Select the required field(s)
- From the Format menu select the Format Field option
- Click on the Font Tab
- Press the [x+2] button to the right of the Size drop down
- Enter the following formula:
IF Len({Customer.Customer Name})>15 Then 8 else IF Len({Customer.Customer Name}) in 10 to 15 Then 9 else 10
- Press the Save and Close button
If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us
|
|
1 | Ted Wade | 25 July |
i am trying to print bar code labels but on the blank labels at top of sheet i want to skip, the bar code field insists upon printing a small bar code, when i st to blank or '' or whatever.
skips all fields and proper number of labels except problem with the one field. trying maybe to change dynamically to times new roman or something other than bar code and then print a blank. Any ideas? |
2 | Julia | 30 July |
Hi Ted
You may want to use a conditional suppression formula, that suppresses the field, when it is blank.
Hope this helps
Julia |
3 | Ajay | 30 August |
can i give font size in decimal like
IF Len({Customer.Customer Name})>15 Then 8.5 else
IF Len({Customer.Customer Name}) in 10 to 15 Then 9.4 else 10.6 |
4 | Julia | 30 August |
Hi Ajay
The font size has to be an integer, it does not see decimals within the programming of Crystal Reports.
Julia |
5 | ceadacoest | 28 May |
Hey, this might be random, but where did you get the html template for this web site? Thank you! |
6 | Mark | 29 May |
what will i do to set font size with decimal in crystal reports? is there any way? |
7 | Deepak | 06 August |
What if in group footer if i want that length should adjust as per name lenght
example (NAME and Quantity) should come like this
ABC-100
2nd Group Footer as the name is on the longer side still it should come
Bhanushali - 200 |
8 | Julia | 12 August |
Hi Deepak,
If I have understood your question correctly, you want the font based on the length of the 2 fields Name and Qty?
If this is the case you modify the formula accordingly:
Len({Customer.Customer Name} + {Customer.Qty}) |
9 | Julia | 12 August |
Hi Mark,
As Stated in the post, it has to be integer, it WILL NOT work with decimals |
|