Author |
Message |
subashp
Newbie
Joined: 20 Nov 2015
Online Status: Offline
Posts: 7
|
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 Logged |
|
Valert16
Groupie
Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
|
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 Logged |
|
subashp
Newbie
Joined: 20 Nov 2015
Online Status: Offline
Posts: 7
|
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 Logged |
|
Valert16
Groupie
Joined: 21 Mar 2016
Location: Spain
Online Status: Offline
Posts: 57
|
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 Logged |
|
subashp
Newbie
Joined: 20 Nov 2015
Online Status: Offline
Posts: 7
|
Posted: 24 May 2017 at 12:34am |
Hi,
Thank you very much ... it is working fine now.
-- Subash
|
IP Logged |
|
|