Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: crosstab -- format summary fields Post Reply Post New Topic
Author Message
rajlan
Newbie
Newbie


Joined: 24 Sep 2007
Online Status: Offline
Posts: 13
Quote rajlan Replybullet Topic: crosstab -- format summary fields
    Posted: 29 Nov 2007 at 10:46am

My report looks like this:

Column1   Col2      Col3   Col4   Col5
Type1     type A    sum1   sum2   sum3
              type B    sum1   sum2   sum3
Type2      type A    sum1   sum2   sum3
              type B    sum1   sum2   sum3
              type c    sum1   sum2   sum3
Type3     type A    sum1   sum2   sum3
              type B    sum1   sum2   sum3
Type4     type A    sum1   sum2   sum3
              type B    sum1   sum2   sum3
              type C    sum1   sum2   sum3
              type D    sum1   sum2   sum3

I want to highlight the summary fields based on Column 1 value.
If col1="Type1" then col2,3, 4&5 should be highlighted with red color
If col1="Type2" then col2,3,4 &5 should be highlighted with blue color and so on
I want a color differentiation between the segments Type1, 2,3 ,4& 5.

Thanks in advance

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 29 Nov 2007 at 11:21am
Have you read through the sample chapters I have online? I have some sample code that discusses this. Plus, in the actual CR Encyclopedia book I put even more examples. Check out the free online chapters and let me know if you still need help.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
rajlan
Newbie
Newbie


Joined: 24 Sep 2007
Online Status: Offline
Posts: 13
Quote rajlan Replybullet Posted: 29 Nov 2007 at 2:55pm
Thanks brian.
 
The following code worked.

In the preview or design mode select all the row labels (Type1, TypeA..), and the summary fields(sum1,sum2...) of the crosstab and right Click -> Format Field -> Font ->Color x+2 -> and enter the following formula

SELECT gridRowColumnValue ("sp_DailySummary;1.Type")

/********replace curly brackets with double quotes **************/

CASE "Type1": crRed

CASE "Type2":crGreen

CASE "Type3": crBlue

CASE "Type4": crPurple

default: crBlack
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 29 Nov 2007 at 3:21pm
great!
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.017 seconds.