Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically changing the font size in Crystal

Status
Not open for further replies.

rnd

Programmer
Jun 30, 2001
44
US
Crystal 8.5 or 9
Database: SQL Server 2K
I want to change the Font size dynamically in Crystal depending on the length of the string because I want to print the name bigger or smaller depending on the length of the string with in the allotted space. I can not grow the field (no space to wrap).
Example:
Plain logic:
If the length of the Company Name > 30 characters then Font size = Arial 10
Else
If the lenth of the Company Name < 30 characters then Font size = Aial 12.
(If Length{Company.Name)>30 then Fontsize = 10 Else
If Fontsize = 12)
This is pretty much it. Is it possible to achieve this in Crystal 8.5 or 9? What is the correct syntax?
Thanks in advance.

 
Right-clich the formula (on the report layout), Format Field, Font Tab, and enter an expression in the font size formula button (X+2). Something like:
----------------------------------------------------------
IF Len({@my_formula}) > 40 THEN 10 Else 11
----------------------------------------------------------

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I assumed the requirement was to &quot;change the Font size dynamically&quot; based on multiple detail-level strings.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
1. What happened to my thank you note for the very quick response from IdoMillet? I didn't return to this site until now and surprised to see my note is missing. Isn't it supposed to be in the thread chain? My sincere apologies.
2. I have another question in the same scenario. Can we change the font based on the number of lines? How?
Please respond.

THANKS IN ADVANCE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top