Print Page | Close Window

Print multiple copies of a label

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9739
Printed Date: 03 May 2024 at 3:27am


Topic: Print multiple copies of a label
Posted By: fouguy01
Subject: Print multiple copies of a label
Date Posted: 19 Apr 2010 at 9:32am
Hello everyone. I've created a report that print a card(label) for every items of my inventory. In my database, I have a field that is telling me the number of copies of each label I need to print. Since I have only one line per item in my database, how can I print the quantity of label needed?



Replies:
Posted By: lockwelle
Date Posted: 20 Apr 2010 at 3:11am
the only way that has been suggested is to use a stored procedure that will create as many lines of an item as the number stored in the database.  By itself, CR cannot manage an arbitrary number.  By which I mean, if you only needed 3 (let's say) you could join the table to itself 3 times and so trick CR into seeing 3...but that is not the case here.
 
HTH


Posted By: fouguy01
Date Posted: 26 Apr 2010 at 4:48am
Here's the solution I found on another site... worked perfectly for me.
 
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:
CODE
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:
CODE
{Order.quantity} >= {Repeater.How_Many}

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}.  


Posted By: lockwelle
Date Posted: 26 Apr 2010 at 7:39am
Interesting solution...While not the most elegant is very effective. 
 
It would be a pain to implement if you're not allowed to alter the database, but otherwise a great solution.
 
Thanks for sharing.


Posted By: fouguy01
Date Posted: 26 Apr 2010 at 10:18am
You can simply create a new database with Access or a simple Excel file, that's what I did and it worked. So no need to alter the actual database. All you need is that all users get acces to the new file.



Print Page | Close Window