Solved

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

Posted on 2012-03-28
3
2,208 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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