Solved

Crystal Reports Change Font Size if length of field is certain length

Posted on 2012-03-28
3
2,150 Views
Last Modified: 2012-03-28
I am using Crystal X1. I have a field that I want the font to be as big as possible depending on the length of that field.

So, if the value of the field is 20 characters long I want the font to be a size 24 because it will fit but if it is 40 characters long it needs to be a font of size 12 (for example) because otherwise it won't fit.

WHen I look at the font tab I see that I can put a formula behind the size but I do not know how to tell it which size to use and I cannot find it in the help.
0
Comment
Question by:bmorriso99
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 400 total points
ID: 37777336
I'm afraid there are no set rules.  Different fonts have different characteristics even if notionally the same size.
You'll have to work out your own rules based on testing various strings  and then set the value accordingly.  For example...

if length({table.field}) >40 then
12
elseif length({table.field})>30 then
14
elseif length({table.field}) >20 then
16
else
24
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 100 total points
ID: 37777629
Another thing to consider is that the display is controlled by the printer driver so if the user of the report has a different printer, you may have to adjust the formula.

I find that it is a good idea to have the same printer driver installed on my machine (don't need the printer actually available) that the users of the report will have.  In that way the report will render on your machine the same as it does for the user.

mlmcc
0
 

Author Comment

by:bmorriso99
ID: 37777818
The first comment is the solution and the second is additional information that is extremely helpful. Thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question