INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Report Development

How do Duplicate Records based on a Quantity Field? by IdoMillet
Posted: 24 Feb 03 (Edited 19 Apr 10)

Problem:
A typical situation is where a number of label copies  must be printed for each order according to the {quantity} field in each order record.

Solution:
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:
-----------------------------------
Order.quantity >= Repeater.How_Many
-----------------------------------

If the ">=" join option is not available, remove the join to the REPEATER table and create this condition in the Record Selection condition:
--------------------------------
{Order.quantity} >= {Repeater.How_Many}
--------------------------------

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

If you are restricted to using an equal join, you can also modify the repeater table to include N records for each quantity N:
1
2
2
3
3
3
...

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

If you need to print "N of M" modify the repeater table to look like this:
N   M
1   1
2   1
2   2
3   1
3   2
3   3
...

Cheers,
- Ido

Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
www.MilletSoftware.com

Back to Business Objects: Crystal Reports 4 Other topics FAQ Index
Back to Business Objects: Crystal Reports 4 Other topics Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close