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

Creating delivery labels with differnet references

Status
Not open for further replies.

kwirky

MIS
Apr 22, 2010
85
AU
Hi,
We have a delivery label which is creating a reference number for each label.
if isnull({BoxLabel.JobNo}) then "*WWPML0" + {BoxLabel.OrderNo} else "*WWPML0" + {BoxLabel.JobNo} + "*"

This works fine. However we need to now amend this so that the reference numbet changes if there is more than one box.

the next box would have a reference number like *WWPTR012345* (with the 12345 being the {BoxLabel.JobNo}, subsequent boxes would have the 0 replaced with the next number, ie *WWPTR112345*, *WWPTR212345*, *WWPTR312345*, and so on.

Is this possible?????

Thanks in advance,
Kwirky
 
It sounds like you need a running total, counting something that's always there and being reset for each change of delivery label. You could then include it in a formula field to create a suitable label.

If you just want a single number, use Truncate. You'll anyway need to use ToText to mix a number with label text.

If you're not already familiar with Crystal's automated totals, see FAQ767-6524.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
We have a table called BoxLabel and the total number of boxes appears per order within the table.

So order 12345 will have an entry in field Boxes of 4.

The end result should be as follows:

Box 1 WWPML012345
Box 2 WWPTR012345
Box 3 WWPTR112345
Box 4 WWPTR212345
 
Do you already have the labels appearing separately for each of the four boxes or is that an issue, also?

-LB
 
Yes, we are getting say 4 separate labels, however at this stage each one has the same reference details.
 
You could try something like this. Create a running total {#cnt} that does a count of OrderNo, evaluate for each record, reset on change of {@refno} (the name of your original formula). Then use a second formula to result in the desired number:

if {#cnt} = 1 then
{@refno} else
"WWPTR"+totext({#cnt}-2,0,"")+
(
if isnull({BoxLabel.JobNo}) then
{BoxLabel.OrderNo} else
{BoxLabel.JobNo}
)

-LB
 
I believe that LB is leading you in the wrong direction. I have encountered just such a problem with a company that sells vegtables.

You will need to create a sub-report with many record lines. You move all your label info to the sub-report and pass the important fields over to it through links. They become parameters in the sub-report.

A large number of detail sub-sections, enough to come the most boxes that an order could possibly have. So if your largest order to day required 10 boxes, create 15 sub-sections.

In each place the constant fields and a formula field (you will need 15 of them in this example) that has the correct integer for that box. So in the first sub-section the box number would be "1". In the tenth it would be "10".

Now use logic to conditionally supress all the subsections that should NOT be print for each order. In the section expert enter a formula in the "suppress" property like this,
{pm-boxes}<10. This would supress the subsection 10 when the number of boxes is less than 10. Of course you would change the constant for each one.

Also, make sure that you check "new page after" for each sub-section so that each label comes out seperately.

Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top