Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grouping by Ranges or Formulas Post Reply Post New Topic
Author Message
Tkelly1006
Newbie
Newbie
Avatar

Joined: 10 Mar 2011
Location: United States
Online Status: Offline
Posts: 6
Quote Tkelly1006 Replybullet Topic: Grouping by Ranges or Formulas
     Posted: 10 Mar 2011 at 7:13am

The person who wrote the lion’s share of our Crystal Reports has just retired and I’m tasked with taking over this role. I have 2 reports that I’m working on that need to be grouped.

1.)     1st one needs to group Jobs by ranges like 1 to 1000, 1001 to 4999, 5000 to 25000 etc. The field this is based on is a summary of Qty Net per job

2.)     2nd one needs to be grouped by formulas that identifies Inventory groups ie: @Wide Web Book =({Inventory ID} in [“1500990220H”, “1500993420”]

 

The problem I’m having with both of these is I’m not sure how to add additional groupings to display these like:

 

1 Report                                   2 Report

 

1 to 1,000                                 Wide Web Book

Job 2345       Qty 121               Item 1500990220H

Job 7465       Qty  667              Item 1500993420

Job 2346       Qty  4877

 

1,001 to 4999                             Mid Web Book                  

Job 98767       Qty 3408             Item 150099444                       

Job 6578         Qty 4534             Item  16254498

etc

 

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Mar 2011 at 7:30am
for 1, I would assume that there is a formula that defines the groups, if not, look at the group criteria.  I right click in the left margin of the group that I want to change and then select Change Group. This might point you in a direction as to which formula might be controlling the group and you can modify it from there.
 
for 2, if it is driven by inventory numbers, you would just add another inventory number into the ["xxxx","yyyy"] section.  The [] is an array, and the IN command is telling the report to search for a match in the list.
 
HTH
IP IP Logged
Tkelly1006
Newbie
Newbie
Avatar

Joined: 10 Mar 2011
Location: United States
Online Status: Offline
Posts: 6
Quote Tkelly1006 Replybullet Posted: 10 Mar 2011 at 7:51am
For report 1 I have a bunch of detail records for each job that show qty produced. I need to group these by Job ID then display them in the range that fits QTY produced
 
Example:
 
Job ID 123 QTY 535
Job ID 234 QTY 1200
Job ID 345 QTY 688
 
On the report I need to show this
 
Range 1 to 1000
Job ID 123 QTY 535
Job ID 345 QTY 688
 
Range 1001 to 5000
Job ID 234 QTY 1200


Edited by Tkelly1006 - 10 Mar 2011 at 7:51am
IP IP Logged
Tkelly1006
Newbie
Newbie
Avatar

Joined: 10 Mar 2011
Location: United States
Online Status: Offline
Posts: 6
Quote Tkelly1006 Replybullet Posted: 10 Mar 2011 at 8:07am
For Report 2 I have Inv Items that belong to specific user defined groups. I have these defined within Formulas 
Example: Wide Web = Item ID 1123, Item ID 3333 and Item 4444
Mid Web = Item ID 99, Item 100, Item 101
 
My group is each Item ID
 
I need to show details for Item ID on report based on user defined Groups
Wide Web:
Item 1123
Item 3333
Item 4444
 
Mid Web:
Item 99
Item 100
Item 101
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Mar 2011 at 10:02am
for the first report, a formula like:
 
if {table.field} in [1,1000] then 1
if {table.field} in [1001,4999] then 2
if {table.field} in [5000,10000] then 3
 
just use the formula to group on instead of a field
 
for the second you could something like
 
local stringvar str:="Unknown";
if {table.field} in ["11123","3333", "4444"] THEN str:="Wide Web";
if {table.field} in ["99","100", "101"] THEN str:="Mid Web";
str
 
again just group on the formula
 
HTH
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