on 03-25-2014 6:53 AM
Hello All,
I am a newbie in Crystal report,from last few weeks, i am working on cross tab crystal report.i have a requirement to show color dynamically for each column.i am adding an attachment how i want it. i tried dynamic coloring using object field formula but it is showing red color to all data.i want red color data when in 2nd cross tab report data is beyond upper or lower limit in first cross tab table. it will be very helpful if somebody will give me any clue on this.... i read so many articles now it seem like impossible for me..:(
i am using visual studio 2010 and sap crystal report version 13.0.0.99 for visual studio 2010.
Hey Guys,i don't know whether it is possible or not. you people have experience in sap crystal report.if you think that it is not possible then please let me know. because after getting response only,i can talk to my management that what they are asking its impossible. at-least give response whether its positive or negative.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manish,
This is not impossible to do however it is not the easiest thing to do either.
Would there always be five clients?
If yes, then you should consider creating a manual crosstab. If not for a manual crosstab, it gets very difficult to compare each value in the crosstab with a corresponding number that is not part of the crosstab - in this case the upper and lower limits.
-Abhilash
Hi
When you create a cross tab it groups the values according to column and row, now how can we related two cross tab groups and write a condition to change the color ?
It is not possible to achieve this through cross tab, but you can create a standard report in cross tab style i.e. mock cross tab.
Here we can refer / use other values to change the color of values.
Example :
If {Client} = 'Client1' and ({Value} < {LowerLimit} or {Value} > {HigherLimit}) Then CrRed Else CrNoColor
-Sastry
Hello Manish,
I have attached a sample report that does this. You will need to remove the .txt extension from the attached file to open it as an .rpt file.
Please right click on one of the value fields of the first cross tab in the report > Format Field > Common > Suppress if Duplicated conditional formula.
The nested formula is as follows;
numbervar array l;
numbervar array u;
numbervar x:=CurrentColumnIndex;
if GridRowColumnValue ('@limit') = 'lower limit' then
(redim preserve l[x];
l[x]:= tonumber(CurrentFieldValue))
else if GridRowColumnValue ('@limit') = 'upper limit' then
(redim preserve u[x];
u[x]:= tonumber(CurrentFieldValue));
false
So it assigns each lower and upper limit value for each client (in the sample it is country) to an array using the cross tabs column index to index the array and it ends in False as we don't actually want it to suppress if duplicated. This nested formula is just used to generate the arrays of upper and lower values.
In the second cross tab if you again right click on one of the value fields > Format Field > Font > Color you will see the following conditional formula;
numbervar array l;
numbervar array u;
numbervar x;
if not(tonumber(CurrentFieldValue) in l[CurrentColumnIndex] to u[CurrentColumnIndex]) then
crred
else
crblack
So this compaes the current field value to range generated by the 2 arrays and assigns a color based on whether or not it is in the range.
Regards,
Graham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hii Graham,
i tried your solution but i am getting array index error in my 2nd cross tab. its not a simple number value. it has some characters also in cell like n/a or null according to selection which client want to choose.
here i am pasting the screen shot of the error as well as my crosstab report screen shot. if any one know the solution then please help me. i was trying from last more than 7 days still not getting any idea to solve it. waiting for response..
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.