cancel
Showing results for 
Search instead for 
Did you mean: 

highlight a cell based on another cell in crosstab

Former Member
0 Kudos

Hi Gurus,

I am trying to highlight the background color of a cell based on another cell.

Scenario below:

1. if a fieldx value = 0, then, highlight the whole crosstab row in Maroon

2. no background color in first column of crosstab

3. if the cell value in crosstab column 2 or column 3  belongs to a string of values, then, highlight the value in column 2 or column 3 as Green.

4. If the cell value in crosstab column 2 or column 3 belongs to a string of values, then highlight the value(s) in any of the columns beyond column 3 , that belongs to a string of values, in Blue.

5. If the cell value in crosstab column 2 or column 3  does not belongs to a string of values, then highlight the value(s) in any of the columns beyond column 3, belongs to a string of values, in Red.

--

Local ITEM

ITEM = TRIM(mid(CurrentFieldValue,3))

if GridRowColumnValue ("@Table.Fieldx") = 0 then

formula = crMaroon

else

      if GridRowColumnValue ("Table.crosstabcolumn")=1 then

    formula = crNoColor

    else

          if instr({StringX},ITEM)=0 then

          formula = crNoColor

          else

              if instr({StringX},ITEM) <> 0 then

                    if GridRowColumnValue ("Table.crosstabcolumn")=2 then

                    formula = crGreen

                    else

                        if GridRowColumnValue ("Table.crosstabcolumn") > 3 then

                        formula = crBlue

                    if GridRowColumnValue ("Table.crosstabcolumn") > 3 then

                    formula = crRed

                    End if

              End if

          End if

    End if

End if

----------

Gurus,

I am unable to highlight blue and red colors correctly

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

I have been trying to reference one cell to another in a row of the crosstab. But, been unsuccessful so far. Any idea if I am on the right path? Is it possible  to compare one cell to another cell  in  a row ?

Am I missing something here??

Former Member
0 Kudos

Still looking for some help on this. I still am not able to reference the color or data of one cell in a crosstab by another cell

local Equip

Equip = TRIM(mid(CurrentFieldValue,3))

if len(Equip) < 4 then Equip = Equip + ","

if  GridRowColumnValue ("@ToiletsCount") = 0 then

    formula = crBlack

end if

if  ({vwv_EquipToilet.GreenToiletCt}=1 and (GridRowColumnValue ("@ToiletsCount") >=1) and (instr({SP_T_Equip;1.T_Equips}, Equip) <> 0) and (GridRowColumnValue ("EQLINK_DTL.eq_order") > 3))  then

    formula = crBlue

end if

if  ({vwv_EquipToilet.GreenToiletCt}=0 and (GridRowColumnValue ("@ToiletsCount") >=1) and (instr({SP_T_Equip;1.T_Equips}, Equip) <> 0) and (GridRowColumnValue ("EQLINK_DTL.eq_order") > 3))  then

    formula = crMaroon

end if

--

The above statement needs to be updated to work dynamically.

abhilash_kumar
Active Contributor
0 Kudos

Hi Devi,

Would you be able to attach the report with saved data please?

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Please find the attached Crystal Report that I am working on

Attached .txt (.rpt type is not allowed to attach( ?))

Please let me know which format you would prefer

(File types allowed: .asc, .txt, .text, .xml, .xsl, .gif, .png, .jpeg, .jpg, .jpe, .ics )

Former Member
0 Kudos

Please check the code I am creating for highligting attached.

I am using CR Developer Version 11.5x

abhilash_kumar
Active Contributor
0 Kudos

Please attach the report 'with saved data'.

Then, change its 'extension' from .rpt to .txt and attach it again here.

-Abhilash

Former Member
0 Kudos

sorry here it is..
PFA

Former Member
0 Kudos

What needs to be highlighted in the crosstab:

'if cell in column 2 and/or 3 has a equip, then highlight that cell in lime.

'if cell in column 2 and/or 3 has a equip ,then highlight all those cells in that row with equip in column > 3 in aqua

'if cell in column 2 and/or 3 does not have a equip, then highlight all those cells in that row with equip in column > 3 in red

Former Member
0 Kudos

Hi Abhilash,

Please let me know if you were able to open the attachment

Former Member
0 Kudos

Hi Abhilash,

Please let me know if this functioanality is possible

Former Member
0 Kudos

Hi All,

I still am looking for a solution.

I would like to know if it is possible to lookup and highlight a cell value based on a value in another cell of a crosstab field

Former Member
0 Kudos

Hi Abhilash,

Can you please help me out on this.

Very much appreciated

Thank you

PFA file.