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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Multiple times from one record

Status
Not open for further replies.

McMint

IS-IT--Management
Apr 21, 2004
7
GB
Can you help me please. We are using Crystal 8.5 with Oracle 9i. We have a requirement to print out labels to a Zebra printer using ZPL language. This is normally not a problem to embed within crystal the ZPL code and pass the variable information as required.

Within ZPL there is a function that tells the printer how many labels to print. This is fine if the information is identical on each label. However we now have a situation where for 1 single despatch record we need to print multiple labels with incrementing serial numbers embedded within a barcode. Embedding the serial number within the human readable text is not an issue. It is the barcode that causes the problem.The ZPL will not allow us to embed a serialisation number within a set of text and print it as a single barcode. So to get around this I am trying to get crystal to print the zpl code for each label required.

Sorry for the long story it was to explain the background.

What I am trying to get Crystal 8.5 to do is print data multiple times from a loop of some sort. As in

for i := 1 to nNumLabels
print @Boxlabel
next

The above is not crystal syntax but it is what I am trying to achieve. The @boxlabel function contains the zpl code for 1 label and I can increment a counter to give me the serial number each time I call it. However I cannot get Crystal to print multiple records from within a loop. It will either print just the one record or gives me TRUE.

Is there a way of printing a string (which is in itself approx 250 characters long) multiple times from a single database record? As the number of labels will vary each time I cannot hard code it.

Any thoughts and suggestions will be much appreciated. Thanks in advance.

Regards
Richard Chambers
 
Crystal isn't a full language and does not allow you to do your own loops.

What you could do is several detail lines, each one a label. You'll be able to use copy-and-paste, though I think 8.5 only allows this for one field at a time.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks very much for your quick reply. The problem is I only have 1 detail line and do not know ahead of time how many labels I will need. There can be up to 50 or more boxes in a shipment so hard coding a section for a box and then supressing it if the number of boxes is less than required is not really practical.

Looks like I may have to try and come at this from the database side and see if I can create multiple detail records for this one customer.

Thanks again.

Regards
Richard Chambers
 
Thanks, That has pointed me in the right direction and I have managed to get it working. Your assistance has been much appreciated.

Regards
Richard Chambers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top