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!

Printing multiple copies of a report 1

Status
Not open for further replies.

icodian

IS-IT--Management
Aug 28, 2001
74
US
My objective is to print labels based on the total quantity of items on a Sales Order. For example, if I sell 15 items on a Sales Order, I would like 15 labels to print. The label is identical for all items.

If there was a quantity of 1 for each line item, this would not be a problem. However, it is possible that the quantity for each line item may vary. E.g. On one Sales Order, I may sell 3 Blue Notebooks and 5 Ballpoint pens. Because all 3 Blue Notebooks are identical, they would be listed together in one line item with a quantity of 3. Same for the pens.

Therefore, I have two line items (i.e. Detail section only runs twice) with a total qty of 8. This means I would like 8 labels to print.

I need to find a way to find a sum of the total qty of items on the Order (easy part), and automatically print this number of labels (hard part). As mentioned, there is only one label type to print...the same label will print regardless of the item.

I had 2 different ideas, but am not sure how to implement either one if it is possible.

1) I was wondering if there was a function to set the "Number of Copies" to print as set in the Printer Setup. If so, is it possible to calculate the sum first, prior to starting to print, set the "# of Copies", then print the correct # of labels?

2) Can I use a subreport? This would involve calculating the qty sum in the main report and passing this total to the subreport where the labels would print based on this sum. If this is possible, how can I tell the subreport to loop through and print the correct number of times?

3) Any other ideas?

Thanks for any assistance!
 
If you can add a table to your database, here is how I recently described a solution on another thread:
--------------------------------------------------------

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

How_Many
--------
1
2
2
3
3
3
4
4
4
4
... (5x5 6x6 etc.)

If your database forces you to have a unique Primary Key in order to enter data, then also create a primary key column
with an auto_number or just enter a unique value there.

Now, in your report, join the {Quantity} field to the
{How_Many} field of this new table.

This would cause each product record to be duplicated as many times as the value of Quantity. For example, if a specific product record has a quantity of '4' it would
end up joined (and hence repeated) to 4 records in the REPEATER table.

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

Cheers,
- Ido
CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ido,

Thanks for the post. This is an interesting idea and one that I believe will work for us.

I appreciate the help.
 
A similar idea to IdoMillet's...

Instead of creating the extra table with multiple entries:

1,2,2,3,3,3

Just create the table with one of each number, up to the max. number of labels you think you might need.

1,2,3,4,5,...,300

Then link your tables using a join statement that will include the records where the linked value is less than or equal to your desired quantity. This will help keep your extra table a little smaller and save you the data entry repition if you are dealing with large quantities...

Good luck!

-bdway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top