Solved

Crystal Report Conditional Formatting not working

Posted on 2009-04-13
3
379 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
Comment Utility
> ... 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
Comment Utility
0
 
LVL 34

Expert Comment

by:James0628
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

20 Experts available now in Live!

Get 1:1 Help Now