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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combined Grouping 1

Status
Not open for further replies.

ts04

Technical User
Jun 14, 2004
69
NL
Hi!

Using: CR 9.0
Database: Btrieve

I would like to create a report like the following:

A 10 11
300 400 500 600 700 300 400 500 600 700
100 4 0 0 0 8 9 0 9 4 0
200 0 8 0 ...
300 ..
400 .
500

A 20 21
300 400 500 600 700 300 400 500 600 700
100 4 0 0 0 8 9 0 9 4 0
200 0 8 0 ...
300 ..
400 .
500

A 22 33
300 400 500 600 700 300 400 500 600 700
100 4 0 0 0 8 9 0 9 4 0
200 0 8 0 ...
300 ..
400 .
500

B 10 11
300 400 500 600 700 300 400 500 600 700
100 4 0 0 0 8 9 0 9 4 0
200 0 8 0 ...
300 ..
400 .
500

etc.

I use 3 groupings:
1:Group on Productcode: A/B/C/D etc.
2:Group on prodtype: 10/11/22/33 etc.
4:Group on Length: 100/200/300/400 etc.

This data I get from a code in my table:

11400500A

From this code code I extract the filtering criteria with a MID function. Everything goes fine except for one little problem:

I can't get the report to show the data of different prodtypes (e.g. 10/11) next to eachother like in the expected output above. Is it possible to say to Crystal Reports to group the data on 2 criteria. Once I have grouped the data on two prodtype criteria I can filter the data in the detail section by checking on type. This I have already created. It lookes like this:

Left part of the table:

if (mid({GEPRS.Prod_code},1,2)="10" or mid({GEPRS.Prod_code},1,2)= "20" or mid({GEPRS.Prod_code},1,2)= "22") and mid({GEPRS.Prod_code},7,4) = "0300" then
{GEPRS.Aant_geprod}

Right part of the table:

if (mid({GEPRS.Prod_code},1,2)="11" or mid({GEPRS.Prod_code},1,2)= "21" or mid({GEPRS.Prod_code},1,2)= "33") and mid({GEPRS.Prod_code},7,4) = "0300" then
{GEPRS.Aant_geprod}

The data in the detail section has been summarized and supressed.

the "0300" represents the height (x-axis below type).

Hoop this makes a little sense. Any help is very welcome!!

Tanja
 
I think you could do this with an inserted crosstab. Group on ProdCode and then instead of grouping on prodtype, create a formula {@prodtypeclusters}:

if mid({GEPRS.Prod_code},1,2) in ["10","11"] then "Group 1" else
if mid({GEPRS.Prod_code},1,2) in ["20","21"] then "Group 2" else
if mid({GEPRS.Prod_code},1,2) in ["22","33"] then "Group 3" else "Group 4"

Then group on this formula. Then insert a crosstab, using a formula {@prodtype} as your first column field:

mid({GEPRS.Prod_code},1,2)

Then use length as your second column field. Use length as your row field, and then insert the summary field (I'm unsure what this is).

Place the crosstab in the Group #2 (Product Type Clusters) header or footer.

-LB
 
or looking at 11400500A

{@formulaGroupMe}

right({GEPRS.Prod_code},1) &
mid({GEPRS.Prod_code},1,1) &
mid({GEPRS.Prod_code},5,4)

which for the above would be A10500
Grouping on that and putting the items for A10 and A11 in that footer (maybe use Running totals that only add when
mid({GEPRS.Prod_code},2,1) = 1 or 0) that way they reset on the group and you get to use the same fields over and over.

A crosstab can be prettier, but it can also be a pain in the rear. B-)

Scotto the Unwise
 
Thanx lbass.

The totals I use are amount produced.

This is a perfect solution because now I have my columns dynamic as well! Minimizing the used printer inkt! :)

Thanx!

Tanja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top