Solved

Crystal Report Conditional Formatting not working

Posted on 2009-04-13
3
382 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 34

Accepted Solution

by:
James0628 earned 500 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 100

Expert Comment

by:mlmcc
ID: 24139263
0
 
LVL 34

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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. …
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 …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

12 Experts available now in Live!

Get 1:1 Help Now