If you are dealing with detail records (not group footers)
then simply set the Background color property to something like:
if Remainder(Recordnumber,2) = 0 then White else Gray
I have the same problem, except the information I want to have alternate shading on is in the Groups. I found some coding in another report, similar to this, but it is not working for my report.
This is in my Group Header #2, on the Color Tab/Background Color formula key.
If Remainder (Groupnumber, 2)<>0
Then Color (240,240 ,240 )
Else Color (255,255,255)
I am really new to Crystal, so I apologize if I don't use the right terminology.
I have also tried the 'remainder' function to alternate background and that works BUT if you have activated 'suppress if blank lines' or define a formula that delete the blank lines, that does not work anymore. You have for ex 5 lines grey then 10 blank the 3 grey and so on ..
thx
good point...I suppose if you are suppressing some records this would not work.
That is why I don't base my counterflag this way...I set it up as an independent sum...such that if the record is displayed then the sum is incremented...that way there is no problem controling the shading Jim Broadbent
I use a running total for linebar type display in the groupfooter.
First I create a running total called ColorCounter.
The field I summarize on is based upon the group footer displaying the data, in my example:
Group4 is Item, so the field to summarize is Item
Type of Summary is Count
Evaluate on the chg of group Item
Reset (in my particular case, it's reset on the next higher level group displayed).
Then in the section format, color tab, I click on the formula button for background color and enter the following:
if remainder({#ColorCounter},2) <>0 then color(227,232,251) else nocolor
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.