Earlier this year I added a couple of blog posts, about using the MOD function to create a banded report. I had a couple of comments, pointing out that although the formulas were correct it did not take into consideration any hidden or suppressed rows of data, in Crystal Reports.
So here's an amendment to those posts.
The two blog posts in question are:
The MOD function
How Do I Create a Banded Report
Solution
- In the Section Expert, select the Details section
- Click on the conditional format button for the Suppress option
- Enter the Suppression formula: {Tablename.FieldName} = Value
- Create a new formula field called Index
- Enter the formula:
WhilePrinting records;
NumberVar Counter;
If {Tablename.FieldName} <> Value then Counter := Counter +1;
- Add the Index formula field to the Details section
- Suppress the Index formula field
- Create the following conditional formatting formula for the Details section:
if {@index} mod 2 = 0 then crSilver else CrNoColor
If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us |