Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Conditional Formating Crosstab Rows Post Reply Post New Topic
Author Message
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Topic: Conditional Formating Crosstab Rows
    Posted: 19 Jun 2009 at 10:43am
Hmm, This crosstab that i've been working on for past few weeks
(sigh they continuesly want something new with it. o well keeps me workin lol)
 
Now they request some conditional formatting. We have an abnormal_flag_ind that has been combound (is that a word, no red swiggly under it so i guess so hehe...) with the results.
 
So basically there's several ind's in this filed. "A", "N", "H", "HH", "L", and "LL" and for these, we want to change the font of the field
so i wrote this in the x-2 of the style section of the font for these:
 
if IsNull ({abnorm_flags}) or {abnorm_flags} = "" or {abnorm_flags} = "N"
    then crRegular
Else
    if {abnorm_flags} = "H" or {abnorm_flags} = "HH" or {abnorm_flags} = "A"
        then crBold
    Else
        if {abnorm_flags} = "L" or {abnorm_flags} =  "LL"
            then crRegular
 
aswell as this in the color section:
 
if {abnorm_flags} = "L" or {abnorm_flags} = "LL"
      then crSilver
 
But, it doesn't modify anything... Everything looks the same...
any suggestions?
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jun 2009 at 12:34pm
Hey Takesen,
You are trying to format cells within the croostab correct?
Try and use the "HighLight Expert".
Right click on the cell you want, clic on NEW to add a new feature
Value of this field is equal to HH set to Bold
add NEW
Value of this field is equal to LL set to Bold and font color to silver,
etc.
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 19 Jun 2009 at 1:52pm

okay, well now i just fill silly for not remembering about the highlighter.

BUT unfortunately the highlighter doesn't appear to be able to work for this....

Because 1, the field i'm basing this off of, is techniqually not IN the crosstab. It's in a formula that the summary is based off of. (the summary is just the Max of the result values for that date)

But the formula is

if IsNull ({abnorm_flags}) or {abnorm_flags} = ""
then
{observ_value}
else
{observ_value} + "  (" + {abnorm_flags} + ")"
 
So i can't really use the formula field to do it, since the highlighter wont let me take the Right({@Result_abn}),3) which would be the Abnorm_flag....
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jun 2009 at 2:29pm
Not sure you can do this (but I am having a little trouble following the setup).
The question of conditionally formating cells in a crosstab seem to come up a lot ...There is the gridRowcolumnvalue("xxxxxx") but this seems to be more about the value of the column or row header than the returned value in the cell.
I'll keep looking but I am not aware of a good way to do this outside of the highlight expert Confused
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 19 Jun 2009 at 2:35pm
Yeah :(
 
I was looking at the gridrowcolumnvalue and currentvalue..... and i can't seem to grasp the concept....  so i haven't been able to attempt to test this. I'm not sure what else to do...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jun 2009 at 2:50pm
gridrowcolumnvalue can be used to change the formating of just one grouping....if gridrowcolumnvalue("table.fieldname")="ABC" then crRed else crBlack
You repalce then{} with "" around the column or row field you want to change and then make it = the header value you want to change.
The currentvalue might be your ticket but again I am not sure what your values are. It does give you a little more control than the highlighter but you are still evaluating the end end result of that cell and not a related field to it.
so you could change font based on the right character of a cell field being = ")" as
if right(currentvalue,1)=")" then crRed else CrBlack
 
Hope this helps.
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 19 Jun 2009 at 3:08pm
Swwwwwwwwwwwweeeeet.
 
if Right(CurrentFieldValue,3) = "H" then
         crBold
Else
          if Right(CurrentFieldValue,3) = "L" then
                   crSilver
 
ect ect works perfect :)
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.012 seconds.