Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Report Conditional Formatting not working

Posted on 2009-04-13
3
Medium Priority
?
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

718 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