Print Page | Close Window

Print Multiple Detail Lines

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=174
Printed Date: 02 May 2025 at 2:17am


Topic: Print Multiple Detail Lines
Posted By: Texian
Subject: Print Multiple Detail Lines
Date Posted: 30 Jan 2007 at 9:35am
I have been able to do almost everything  with CR, but I have not been able to figure out this design.  I want to be able to print serial number labels.  The data base stores a job number and quantity.  What I want to do is pick up the job number and then print out a series of labels that show the job number along with another digit that gets incremented each time the line is printed, up to the quantity ordered.  I know I need some type of loop, but I have not been able to figure this out, at least with the CR help files.  Any suggestions or ideas will be appreciated.

-------------
Texas Prof



Replies:
Posted By: hilfy
Date Posted: 31 Jan 2007 at 12:25pm

Do you have a max quantity number?  The one way I can think of to do this will only work if that max quantity is not too large.

1.  Create as many detail sections as the max quantity number.
2.  Put the same fields/format in each of the detail sections.
3.  In the suppress formula for each detail section, but something like the following: 
<X> <= {table.quantity field}
Where <X> is the number of the details section (1 for section A, 2 for section B, etc.)
 
I'm not sure what the max number of sections for a report is, but I just verified that you can put more than 26.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: Texian
Date Posted: 01 Feb 2007 at 2:56pm
I appreciate your response.  It sounds like a good solution.  Thanks for your help.

-------------
Texas Prof


Posted By: BrianBischof
Date Posted: 01 Feb 2007 at 4:02pm
Ok, here is another idea for getting Crystal Reports to print multiple mailing labels (but only if you have control over your database). Create a SQL table, Labels, with just one field (LabelNumber) and create as many rows as you need for the max number of labels (say 1 to 100) with the values being sequential. Then do a SQL statement that joins the new table to your existing table and use the LabelNumber field as the linking field. You have to do something similar to the following:

select * from DataTable
join Labels
on Labels.LabelNumber<=DataTable.NumToPrint

What this does is create a resultset that has multiple records joined to the Labels table for each record that has a value less than or equal to the number of labels to print (did that make any sense?) It effectively duplicates each row from DataTable as many times as necessary based upon the NumberToPrint field (or whatever yours is called). Anyway, if you can make sense of the SQL statement and use the correct fields, this should do the trick for you.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window