Solved

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

Posted on 2012-03-28
3
2,438 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 101

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

615 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