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

Help with shipping label

Status
Not open for further replies.

chvchk

Programmer
Aug 18, 2004
33
US
Crystal version 8.0
Pervasive.SQL v8
Connection via ddf

I've created a Shipping Label per a customer's very specific requests and specifications that will connect to our ERP database and collect the part number and other applicable information to be output on the report.

There is some information that needs to be collected at runtime, such as the number of boxes, quantity per box, and box weight. This data is not available in our database.

For example, a particular shipment has 3 boxes. The first box has a quantity of 288 with a weight of 18.00 pounds. The second box has a quantity of 100 with a weight of 9.5 pounds. The third box has a quantity of 20 with a weight of 5.25 pounds.

Desired output as follows:
Label 1:
Box 1 of 3 Quantity: 288 Weight: 18.00 Pounds

Label 2:
Box 2 of 3 Quantity: 100 Weight: 9.50 Pounds

Label 3:
Box 3 of 3 Quantity: 20 Weight: 5.25 Pounds

In a rush to get this label working, I set these fields to be populated by a parameter field placed on the label, but the shipping department has to print a new label for each box, going back through each prompt again. Is it possible for them to enter the data for each box by storing each variable in an array to be printed all at once as shown above? I've had very little experience with arrays so I'd appreciate as much help as possible (if this can be done).

I hope I've been descriptive enough please let me know if I've left something out.

 
Dear chvchik:

You should be able to change your parameter to a multi value parameter (it has to be a string because the number one rounded up 9.5 to 10 and I couldn't find a way to get it to accept exactly what was typed):

When the report is run, the user will be prompted to enter the data and can enter:
Each "number" clicking the add button each time.
3,288,18,100,9.5,20,5.25

Then you just reference the aray element.

Here are some functions that will help:

ubound({?YourParameter}) will tell you the number of elements.

So if the first element in the array is the number of boxxes, and you always have 2 elements per box (qty and weight) then you can verify that the number of elements matches the number of boxes and hence labels.
(ubound({?YourParameter})-1)/2

So if Ubound returns 7, and tthe formula above returs 3, it should be equal to the first value for the number of boxes (3)

If it doesn't match, you can place text on the report that states, values don't match number of boxes entered .... or you could create an alert to do the same.

That should give you the number of values.

Box one qty would be

{?YourParmater}[2]

weight would be

{?YourParmater}[3]

and so on....

Hope that helps,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Thank you Rosemary!

I've armed myself with the guide from Crystal Decisions for using arrays as well as some of their sample array style reports.
It's been a few years since I've done anything with arrays and that time was very brief.
But I think this will do the trick if I can work my way through the guide and samples and will possibly help me with solutions to future reports.
Thank you for pointing me in the right direction.
 
One more question that came to me as I'm reading through arrays and developing the code I need that will accomplish this task....

When the user inputs the number of boxes for shipment, I would like this to then print out the appropriate number of labels while populating the label fields with the provided parameters. So if the user indicates there are 3 boxes total and answers the prompts to populate the quantity and weight fields, what is the best method to design the report to print 3 labels?

Can I group on the parameter that gets the total box count? Or is this something that needs a repeater table created as I've read in other threads regarding incrementing labels?
I don't want to get too far into my design to find out I need to start over from a different angle.
Thanks again for your help so far.
 
It sounds like what you really want is a report that lists things to ship. You want the user to be able to click on one of the items, enter some information, and then get a printout of the specified number of labels.

Consider doing this with an OnDemand subreport that has its own parameters. In that case, yes, you would need to use the Repeater table approach as described in my faq: faq149-3226
Also, in such a scenario, the user will have to manually (click Print button) initiate the printing after providing the parameter information to the subreport. Then, the user will have to return to the main report layout...

If you wish to avoid the extra clicking and navigation involved in that approach, consider using a 3rd-party tool (see list at: At lease one of the viewers can respond to a user double-clicking a certain section on the report by prompting the user to enter information and embeddng that information (as well as information from the clicked main report section) in a command line call to print another report.

Regardless of the method you decide to use, the underlying reason for the complexity is that what you really need is a system that accepts the information and stores it in a database (or excel) for use by Crystal. Crystal is not designed to display information and then accept further input from the user (the exception being OnDemand subreports with their own parameters...).

- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top