Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Formatting crosstab values based on row value Post Reply Post New Topic
Author Message
subashp
Newbie
Newbie


Joined: 20 Nov 2015
Online Status: Offline
Posts: 7
Quote subashp Replybullet Topic: Formatting crosstab values based on row value
    Posted: 22 May 2017 at 12:06am
Hi All,

I have a requirement in Cross Tab report like below.

      Sal      Operations
1995 100      250
1996 200      450
.
.
2015 350      850
2016 500      540

We are passing year value in the report. When ever the Year value equals to parameter value then it should be BOLD and Font Size 12.
This one i have achieved.
At the same time the particular values in the row i.e. Sal and Operations also should be BOLD and Font Size 12.
For these values i am not able to achieve.

Please help me on this issue.

Thanks,
Subash
IP IP Logged
Valert16
Groupie
Groupie
Avatar

Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
Quote Valert16 Replybullet Posted: 22 May 2017 at 11:20pm
You can get it using the GridLabelAt function. Use a conditional formating formula for font style and size of every value you want to highlight.
Font style:
If GridLabelAt ("NameOfYearRow", CurrentRowIndex) = {?NameOfYearParam} Then crBold Else DefaultAttribute

Font size (supposing 10 as original size):
If GridLabelAt ("NameOfYearRow", CurrentRowIndex) = {?NameOfYearParam} Then DefaultAttribute + 2 Else DefaultAttribute

Edited by Valert16 - 23 May 2017 at 6:16am
IP IP Logged
subashp
Newbie
Newbie


Joined: 20 Nov 2015
Online Status: Offline
Posts: 7
Quote subashp Replybullet Posted: 23 May 2017 at 8:04pm
Hi,

Thanks for your reply.

When i am using the formula which you mentioned ...
If GridLabelAt ("NameOfYearRow", CurrentRowIndex) = {?NameOfYearParam} Then crBold Else DefaultAttribute

getting error like "A string is required here".

It is highlighting on "NameOfYearRow" place.
For this i have converted numeric column to text.

Even though i am getting the error.

Please suggest me on this.

Thanks,
Subash
IP IP Logged
Valert16
Groupie
Groupie
Avatar

Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
Quote Valert16 Replybullet Posted: 23 May 2017 at 11:25pm
Hi,
The error says that Crystal expects a valid string as the first parameter of GridLabelAt function.
You must replace the string "NameOfYearRow" (mantaining quotation marks) with the year field name in your crosstab. No need to change any data type.
e.g., if the year field name is MyTable.MyYear, you must type "MyTable.MyYear" (without curly brackets). Or, if it is a formula field named @year, then you should type "@year".
(I'm supposing you're not using an alias for the year field).
Hope this works.

Edited by Valert16 - 23 May 2017 at 11:37pm
IP IP Logged
subashp
Newbie
Newbie


Joined: 20 Nov 2015
Online Status: Offline
Posts: 7
Quote subashp Replybullet Posted: 24 May 2017 at 12:34am
Hi,

Thank you very much ... it is working fine now.

-- Subash
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.016 seconds.