Solved

conditional font size for crystal report field

Posted on 2008-10-27
8
2,514 Views
Last Modified: 2008-10-28
in the formula workshop of Crystal version 9, I am trying to make strings above a certain length a smaller size and different font, something like below, which is obviously wrong.

if ({myfield.ClientName}.length > 40) then
font.size=9
font.style = arialnarrow
end if

Can this be done, and if so, what is the syntax?
0
Comment
Question by:waltraud2000
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 16

Expert Comment

by:wykabryan
ID: 22815412
No within 9 it can not be done.  What you could do though is create another section below it and conditionally suppress one or the other if the lenght> 40.
0
 

Author Comment

by:waltraud2000
ID: 22815715
In this case it is a crosstab, and client will not accept all entries in this field being in a small font. She was willing to accept just one unusually long entry in that small font. My above attempt was supposed to be a workaround for not being able to grow the field in a crosstab.

So I guess there is no way to conditionally change one entry's format within a crosstab in version 9?
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 22815732
No. there is not in 9, 10, 11, or 12(possible).. just to help you out with that..
0
 
LVL 5

Expert Comment

by:jgbreeden
ID: 22818140
In 8.5, when I right-click on a field in the report, I can go to Format Field, click on the Font tab, and click the formula button next to font size, name, color or whatever.  If you go into the formula for size, you just need to return the numeric for the size you want, i.e. if (length({ClientName}) > 40 then 9 else 12.  Same thing with the font name, just return a string that matches a font name.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 100

Expert Comment

by:mlmcc
ID: 22819217
That does work in a crosstab.

Right click the cross tab field
Click FORMAT FIELD
Click the FONT TAB
Click the formula button bext to SIZE
If Length(CurrentFieldValue) > 40 then
8
else
10

Similarly for the font

mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 22819227
For the font use

If Length(CurrentFieldValue) > 40 then
   "Arial Narrow"
else
   "Arial"

mlmcc
0
 
LVL 16

Expert Comment

by:wykabryan
ID: 22820903
Right Cross tab will allow font changes. jgbreeden in the later version there isnt a place for formulas next to the format text font area. (X+2)
0
 

Author Comment

by:waltraud2000
ID: 22821901
Was coming back to say I'd found the solution here, and others beat me to it:

http://www.experts-exchange.com/Database/Reporting_/Business_Objects/Q_22428311.html?sfQueryTermInfo=1+condit+crystal+format+report

Thanks everyone!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now