Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping in Crystal Report Post Reply Post New Topic
Author Message
ching29
Newbie
Newbie
Avatar

Joined: 25 Dec 2012
Location: Philippines
Online Status: Offline
Posts: 2
Quote ching29 Replybullet Topic: Grouping in Crystal Report
     Posted: 26 Dec 2012 at 2:18pm

I have a Stored Proc that executes and outputs like this,

Plant1     Top1       12
Plant1     Bottom1    12
Plant1     Top2       14
Plant1     Bottom12   14
Plant2     Top1       34
Plant2     Bottom1    34
Plant2     Top2       18
Plant2     Bottom12   18

and I want it to be displayed like this in the Crystal Report.

Plant1
   Top
     Top1        12
     Top2        14
Total Top 26

 Bottom Bottom1 12 Bottom1 14
Total Top 26
Plant2 Top Top1 34 Top2 18
Total Top 52
 
Bottom Bottom1 34 Bottom1 18
Total Top 52

I am thinking of grouping it by packing plant and then group it again to achieve this kind of output. Somebody there who can help me, PLease.

By the way, I am using Crystal Report 9.

ching29
IP IP Logged
shanth
Groupie
Groupie


Joined: 06 Aug 2012
Location: United States
Online Status: Offline
Posts: 75
Quote shanth Replybullet Posted: 27 Dec 2012 at 9:25am
You are thinking in right way,
Group By Plant, next group by Top, Group By Bottom, in same Hierarchy(Group Expert).
Place fields accordingly in the Group Headers/ footers to display as you wish.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Dec 2012 at 10:59am
well, you can't group by top and then by bottom...they are just entries, I would think that you would group by a formula.  If the entries are just top and bottom, then you could create a formula like:
left({table.field}, 3)
 
the display for the group would be something like:
if left(table.field},3) = "top" then
  "Top"
else
  "Bottom"
 
if the entries are more varied, obviously the formula will get more complex, but you would need to find a way to split entries correctly into different groups.
 
HTH
IP IP Logged
ching29
Newbie
Newbie
Avatar

Joined: 25 Dec 2012
Location: Philippines
Online Status: Offline
Posts: 2
Quote ching29 Replybullet Posted: 28 Dec 2012 at 1:47pm
Yes. I already solved this problem. Now, what I need to do again is add a summary of the report but not adding a subreport. It will be included on the main report. It is like this,

Plant1
   Top
     Top1        12
     Top2        14
   Bottom
      Bottom1    12
      Bottom1    14

Plant2
   Top
     Top1        34
     Top2        18
   Bottom
      Bottom1    34
      Bottom1    18

Total
   Top
     Top1        46
     Top2        32
   Bottom
      Bottom1    46
      Bottom1    32

Showing a total per Top and bottom at the end. Please help.

ching29
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 31 Dec 2012 at 4:01am
use a crosstab or running totals
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum