Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional formatting in cross tab

Status
Not open for further replies.

neskin

Programmer
Mar 13, 2002
104
AU
hi,
i have cross tab report.
Trying to conditionally show the color of cell based on another field .
i have 2 fields as 2 row field1 and field2
if field2 >0 then field green
what i did
selected a cell(field2) ->right click->common->suppress->x+2 and enter:

whileprintingrecords;
numbervar mis_days :=currentfieldvalue;
true -- no needs to display a field in cross tab

then
selected a cell(field1) ->right click->change border->background->x+2 and enter:
whileprintingrecords;
numbervar mis_days;
if currentfieldvalue <> 0 and mis_days > 0 then crlime else crwhite
does not work for me
any help will be appriciated

Nat

 
Crosstabs do not have cells in the sense that Excel does. So what is field 1 and field 2? a row field, a column field, or a summary field?

Please show sample data and desired results.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If the phone doesn't ring, it's me".....Jimmy Buffet
 
the field1 and field 2 are summarized fields
 
You can selectively format the field, right-click and format field. Changing field colour, size and font are useful options. But I'm not sure you'll be able to access the crosstab value for a conditional format.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
The field that you are checking needs to be the first summary, so that if you are checking the value of field2 in order to color field1, then your first summary must be field2, followed by field1.

-LB
 
Change your second formula to:

if currentfieldvalue <> 0 and numbervar mis_days > 0 then crlime else crwhite

This worked for me in Crystal 8.5

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I have tried lbass and dgillz options did not work for me.
I may be a bit more specific
I am using crystal XI
in cross tab
rows: rmtid,location

columns: @Label_month_year(MonthName (tonumber({t.MONTH}),True)+' '+totext({t.YEAR})) ,
timeofday(day,night)


summarized fields: @missing_days(if {t.DAYS} = 0 then 0 else ({t.MONTHDAYS}-{t.DAYS})),
t.value

if @missing_days is not 0 then border of value green else white
thank you
 
When you say it did nit work, can you be more specific? Any error messages when saving the formula or while running the report?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
ok, question. The first formula is:

whileprintingrecords;
numbervar mis_days :=currentfieldvalue;

Why is this entered in the conditional suppress formula? Also it needs to evaluate to true or false.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
it is evaluated to true no need it to show in cross tab
 
I'm trying to help, but you seem to keep ignoring me.

Is that your first formula, yes or no?

If yes, then the formula is wrong because it does not evaluate to true or false.

If no, please post your formula - as in cut and paste it directly from crystal.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I just recreated your crosstab and used the formulas in your first post, and it worked perfectly. Can you verify that the summary you are trying to color is the second summary?

-LB
 
sorry digillz , I am not ignoring you :).I did not understand
u ask me if it was evaluated i said yes if you look at my first post
whileprintingrecords;
numbervar mis_days :=currentfieldvalue;
true -- no needs to display a field in cross tab
that what i have.

For Lbass yes i am verifying it is the second summary
what i did not mention that i have another condition under font -> color ->x+2

if currentfieldvalue = 0 then
crblack
else
if (cdbl(currentfieldvalue) > (cdbl({t.value}) + {?variance}))
or (cdbl(currentfieldvalue) < (cdbl({t.value}) - {?variance})) Then
crred
else
crblack

?variance - parameter




 
lbass it is working now .I have deleted everything and did again. Thank you all of you for your time .
PS dgillz i did not want to upset you
 
Neskin,

No problem, I just wanted to help.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top