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

Items with Groups Questions

Status
Not open for further replies.

mawh

IS-IT--Management
Sep 19, 2006
7
US
I use CR 11.
I have a report with 3 groups. Groupings are based on three different formulas (gp1, gp2, gp3).

There are a handful of item codes that would appear in two different groups for gp2. How can I group the items so that the same item can be in multiple gp2 groups? This is like a product price book - in which items are broken into categories, then subcategories-yet several items are in multiple sub-categories. Thanks.

Thanks.
 
That isn't how grouping works. The idea of grouping is to categorize EACH element.

To emulate this, you might use a subreport and query the database a second time, or even use a Command Object with a UNION ALL query to get the appropriate data in more than once.

I'm afraid that I cannot help you beyond this as you didn't post the criteria for these formulas, which probably should be one formula, nor the databse being used.

In general it's best to go ahead and post technical information rather than trying to describe it.

Try posting:

Database used
Example data
Expected output

-k
 
My data is organized as follows:

icitem01.item = item code
icitem01.pricesort = primary catalog category
icitem01.catcode = secondary catalog category
icitem01.mfgcode = additional coding for grouping the items.

GP1 groups on {icitem01.pricesort}
some lines from gp1 are:
if {icitem01.pricesort}="1020" then "Floor Care" else
if {icitem01.pricesort}="1030" then "Cleaners" else
if {icitem01.pricesort}="1040" then "Degreasers" else "None"
GP2 groups on {icitem01.catcode}[1 to 3] i.e.
if {icitem01.catcode}[1 to 3]="100" then "Glass Cleaners" else
if {icitem01.catcode}[1 to 3]="101" then "General Purpose Cleaners" else
if {icitem01.catcode}[1 to 3]="102" then "Degreasers" else
if {icitem01.catcode}[1 to 3]="103" then "Oven Cleaner" else "Others"
GP3 groups on {icitem01.catcode}
if {icitem01.catcode}="115100" then "Hand Held" else
if {icitem01.catcode}="115200" then "Metered" else
if {icitem01.catcode}="115300" then "Micro Metered" else
if {icitem01.catcode}="115400" then "Total Release" else "Others"

I have another field {icitem01.mfgcode}. In some cases I need the same item in two of the gp2 groups. I was attempting to use mfgcode like below to achieve this:
if {icitem01.catcode}[1 to 3]="100" or {icitem01.mfgcode}="D" then "Glass Cleaners" else
if {icitem01.catcode}[1 to 3]="101" then "General Purpose Cleaners" else ....
this way an item with catcode[1 to3]="101" would end up in "General Purpose Cleaners" and the same item would end up in "Glass Cleaners" because mfgcode = "D".

I guess the bottom line question - is can an item appear in multiple same level groups in crystal reports?
 
If you decide to post what was requested of you, the database being used, example data and the expected help I'll gladly try to help you.

No, data does not show up in multiple groups in Crystal, or in SQL, or in any database process I'm aware of.

That's why UNION queries, subqueries and subreports are so useful. The sort of thing one might use to accomplish what you are after.

So if you create the report using these 3 different group levels, then you insert a subreport into the appropriate group headers or group footers, you can link to the data that is appropriate for each.

Or you might write SQL using UNION ALLs with the criteria to build out the data required to have it already appropriately duplicated.

Without knowing the database used, seeing example data and knowing what you intend as output, it's hard to advise you well.

Since you've had your "guess the bottom line question" answered twice now, that data does not duplicate itself across groups, coupled with the fact you're unwilling to supply the requested information, I cannot assist you further.

-k
 
In addition to the approaches that SV mentions, if your goal was to summarize the data in various groups, you could instead use conditional formulas or running totals to summarize whatever clusters of items you wish for display in the report footer. But of course, it depends upon your ultimate goal.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top