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!

Repeat set of details via a Group?

Status
Not open for further replies.

StephHansen

Programmer
Dec 26, 2001
87
IN
Each order can be identically repeated and there is a column in our table that shows this: CUR_ORD_QTY. So, if that number is 20, I should have 20 identical copies of that order printed out. How can I tell CR to do this and increment the number of that order that it is.

For example...Order 1234 is actually 20 orders that contain all the same items and details. How can I get make CR print 20 of that order and have it iterate 1/20...2/20...3/20...etc (similar to page 1 of 20, etc-but an order can take up more than one page based on the number of items it has)?

I think a group is the way to go but I am not certain how to get started. Any help would be great!

Thanks in advance!!! Stephanie
 
I think I'm going to turn this into a FAQ:
--------------------------------------------------------

Create a "REPEATER" table with a single column (How_Many) that looks like this:

How_Many
--------
1
2
3
4
5
6
etc.

Now, in your report, add the Repeater Table and add a join
condition of:
--------------------------------
CUR_ORD_QTY <= Repeater.How_Many
--------------------------------

If the &quot;<=&quot; join option is not available, remove the join, and simply create this condition in the Record Selection condition:
--------------------------------
{CUR_ORD_QTY} <= {Repeater.How_Many}
--------------------------------

This would cause each order to be duplicated as many times as the value of {CUR_ORD_QTY}.

Group by Order and create formulas to return the number within the group (for example a Running Total count that gets reset for each Order) to provide the &quot;N&quot; portion of
the &quot;N of M Copies&quot; output.

Now, just print your labels... :eek:)

Cheers,
- Ido
CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I set the join with cur_ord_qty <= repeater.how_many and ran the report, no change, same amount of records. I added a group of repeater.How_Many and got 1100 records. Yikes!

What did I do wrong? Stephanie
 
Just place or use the How_Many field in the detail section (it can be suppressed).

By the way, I forgot you don't need a Running Total.
The How_Many field gives you the &quot;N&quot; portion of the &quot;N of M Copies&quot; output. &quot;M&quot; is simply the count of records in each Order group.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Also, my &quot;details&quot; are actually subreports and I have placed them in each of their own sub-headers under the Group Header of Orders. Does this make a difference?(Header 1, GH1a, GH1b, and GH1c).

Thanks! Stephanie
 
OK...

I missed your earlier response, I have now added the how_many field to the details section.

In an order that has a cur_ord_qty of 2, I see the number 2 and there is no repeat of the order.

I have tried this both with just the selection formula and with an inner join with cur_ord_qty<=repeater.how_many (individually, not together)

Thanks for your help!
Stephanie
 
I suspect you are looking at a group section (order_id perhaps) instead of a detail section.

You should definitely see 2 detail sections for an order that has a quantity of 2.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Yes, I am looking at a group section, that is what I need repeated. Can this not be done if this is the case?

If I put the subreports into the detail sections, they bleed onto each other and do not show up in the order I need them to.

Thanks for your help Stephanie
 
You need the detail sections.

Please explain in more detail what you mean by &quot;Bleed&quot;
and why you can't sort the detail sections.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
When I seperated the subreports into Details a (materials), b (products), and c (notes). It would appear as b,c, a, with the details of a (the materials) overlapping the c(notes) section so that you could not read the details. The same happened when I placed them all in one detail section. This is why I placed them in their own groups.

Stephanie
 
If you make sure the &quot;Underlay Following Section&quot; formatting option for these sections is turn off, the problem should go away.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top