Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Print Multiple Detail Lines Post Reply Post New Topic
Author Message
Texian
Newbie
Newbie
Avatar

Joined: 30 Jan 2007
Location: United States
Online Status: Offline
Posts: 2
Quote Texian Replybullet Topic: Print Multiple Detail Lines
    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
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet 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
IP IP Logged
Texian
Newbie
Newbie
Avatar

Joined: 30 Jan 2007
Location: United States
Online Status: Offline
Posts: 2
Quote Texian Replybullet Posted: 01 Feb 2007 at 2:56pm
I appreciate your response.  It sounds like a good solution.  Thanks for your help.
Texas Prof
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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.


Edited by BrianBischof - 01 Feb 2007 at 4:12pm
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>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.