Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Report Conditional Formatting not working

Posted on 2009-04-13
3
Medium Priority
?
414 Views
Last Modified: 2012-05-06
I have the following conditon on the Format Field (Font) of a field on my crystal report.  The formattiong works fine for Glucose > 400.0 but does not work for A1C > 5.  I cannot figure out why.  Does anyone have any ideas?

if trim({LTN7_GLab_View.TestCode}) = "GLU" and {@NumResult} > 400.0 then crbolditalic
else 
    if trim({LTN7_GLab_View.TestCode}) = "AIC" and {@NumResult} > 7.0 then crBoldItalic

Open in new window

0
Comment
Question by:kshumway
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
James0628 earned 2000 total points
ID: 24134600
> ... but does not work for A1C > 5.

 Two things.
 1) You show A1C (the number 1 in the middle) there, but in the formula you have AIC (the letter I in the middle).

 2) You show 5 there, but you have 7 in the formula.

 Your formula looks OK, provided that you have the right values in it.


 FWIW, it might be a good idea to add a "default" value for when neither condition is true.  For example:

if trim({LTN7_GLab_View.TestCode}) = "GLU" and {@NumResult} > 400.0 then crbolditalic
else
    if trim({LTN7_GLab_View.TestCode}) = "AIC" and {@NumResult} > 7.0 then crBoldItalic
    else crNormal


 FWIW2, you could also combine the two conditions:

if (trim({LTN7_GLab_View.TestCode}) = "GLU" and {@NumResult} > 400.0) or
 (trim({LTN7_GLab_View.TestCode}) = "AIC" and {@NumResult} > 7.0) then crBoldItalic
else crNormal

 James
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24139263
0
 
LVL 35

Expert Comment

by:James0628
ID: 24147717
It looks like it.  FWIW, I didn't see that post until after I posted here.  I suppose this question should be deleted, since it's a duplicate.

 James
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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…
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 …
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

886 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