Solved

Crystal Report Conditional Formatting not working

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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 …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

805 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