Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

Want robust solution for alternating row color, resetting every group

$
0
0

I would like a solution for displaying an alternating row color for my detail rows that resets every group, so that row 1 is always gray.

 

Our Crystal designer provided this code to me:

 

 

@rowcnt formula, suppressed, placed in Detail row:

Shared numbervar rowcnt;

rowcnt := rowcnt + 1;

 

 

@resetrowcnt, suppressed, placed in Group row:

Shared numbervar rowcnt;

rowcnt := 0;

 

 

Formatting formula, placed in Color in Detail > Section Expert:

Shared numbervar rowcnt;

if Remainder(rowcnt, 2) <> 0 then

color(241,241,241)

else

crWhite

 

 

This was working fine for me.

However, it is suddenly not working in one of my reports.

The report does happen to have two groups (rowcount.png).

When the report is run, all rows are colored (rowcount02.png).

 

This report was previously working fine!  I'm not sure what changed.

 

In any case... surely there must be standard code to do this very standard formatting.

I would be very grateful if someone could post some robust code to accomplish the following:

 

REPORT DATA IN DETAIL ROW, ALTERNATE ROW BANDING:

 

- Data in Detail row displays alternating row colors

- Odd rows are always shaded, even rows not

- Banding resets every group / does not continue pattern from previous group

 

 

REPORT DATA IN GROUP ROW, ALTERNATE ROW BANDING:

 

Some of our reports place row data in a group row (just the way it happened).

If you could also modify your code in this case.

 

Thank you!


Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>