hg05
hg05

Reputation: 47

Crystal reports use cross tab if > 1 replicate or a particular column else use normal row

Example data:

enter image description here

I want to use cross-tab reporting if the RepCt is greater than 1 for 1 Name but use normal reporting if RepCt = 1 as shown below. If RepCt 1 is cancelled as in the red row in the image, my suppression formula does not work. I am trying to use Count ({repCt} and Maximum({repCt}) to suppress the crosstab and simple version. The count comes up as 6 - which works OK for the crosstab but count comes up as 2 for the simple version since there is a cancelled and a non-cancelled result. Maximum also returns 2. Is there some way I can get it to show as 1 record so it can come as a simple version. as in the Rows 10 to 13 of the picture.

Upvotes: 0

Views: 21

Answers (2)

MilletSoftware
MilletSoftware

Reputation: 4026

Cancelled cases can be removed via the record selection formula.

If for some reason you can't do that, you can create a conditional count for each group that ignores cancelled cases. For example, create a formula that return 0 if canceled and 1 if not cancelled. SUM that formula to get a conditional count of how many rows within the group are not canceled.

Upvotes: 0

MilletSoftware
MilletSoftware

Reputation: 4026

Group the report on RepCt.

Right-click the Group Footer section handle area (on the right) and select 'Insert Section Below'. This would result in having 2 Group footer sections: GF1a and GF1b.

In GF1a insert the CrossTab and in GF1b insert the simple version.

Use an expression in the Suppress property of each section to control when it is visible.

Upvotes: 0

Related Questions