cancel
Showing results for 
Search instead for 
Did you mean: 

background formatting in crystal reports

0 Kudos

I have a Crystal Report in Vs 2010. I'm Trying to format the background of a Column, Based on data values. Using this code only the first condition Works because I tried to switch the if conditions and again only the first condition works.


IF {TBM_Report_qry.DiF}<={TBM_Report_qry.tbm} then RGB(234,234,234)
else
(
  IF {TBM_Report_qry.inproduction_DiF}<={TBM_Report_qry.Reqired}
  then RGB(234,234,234)
  else
  (
  IF {TBM_Report_qry.DiF_Close}<={TBM_Report_qry.clse_Diff}
  then RGB(234,234,234)
  )
)

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I have it Solved

I just needed to check for null Values!

Here is the working Formula.


IF Not ISNULL({TBM_Report_qry.DiF}) AND {TBM_Report_qry.DiF}<={TBM_Report_qry.tbm} then RGB(234,234,234) // uses required date

else

IF Not ISNULL({TBM_Report_qry.inproduction_DiF})AND{TBM_Report_qry.inproduction_DiF}<={TBM_Report_qry.Reqired} then RGB(234,234,234) //uses tentative date

else

IF  Not ISNULL({TBM_Report_qry.DiF_Close})AND {TBM_Report_qry.DiF_Close}<={TBM_Report_qry.clse_Diff} then RGB(234,234,234) // uses closing date

else   crNoColor

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi John,

Try:

If ( {TBM_Report_qry.DiF}<={TBM_Report_qry.tbm} OR {TBM_Report_qry.inproduction_DiF} <={TBM_Report_qry.Reqired}  OR {TBM_Report_qry.DiF_Close} <= {TBM_Report_qry.clse_Diff})

then RGB(234,234,234)

else crNoColor

-Abhilash

0 Kudos

Thanks Abhilash Kumar For your reply.

But it still doesn't work the second and third condition don't get formatted.

I tried switching the second condition with the first one all the formatting that ocured with {TBM_Report_qry.DiF}<={TBM_Report_qry.tbm} no longer were formatted and the {TBM_Report_qry.inproduction_DiF} <={TBM_Report_qry.Reqired} which were not formatted now they are.

All this with out modifying the data.

Thanks in advance.