Adding Weights of a Repeat Item

Hey All,

I am customizing our Bill of Lading (Picking Ticket) so that it will calculate and print the Net and Gross weight of each item on the ticket. I have just about everything worked out. Where I'm stuck is when there is an item that is repeated on a separate line.

For instance:

If we make a ticket that contains 15 pails of Product A. 10 pails of Product A come from Lot#1234 and 5 pails come from Lot#5678. Each instance of Product A is separated onto its own line by Lot#

My formula calculates the Net properly but adds the the Gross weight for all 15 pails and prints the total on each line. I want the formula to print the Gross by Lot#. Is there a way I can use the Lot as the variable to  separate the Gross weights for each line, even though they are the same product.

Below is what the BOL looks like if there are multiple lines of the same product, but are pulled from different Lots. There are a few more lots that aren't included in the screen shot, but notice how instead of calculating the Gross Weight of each line, it adds them all up and prints the total on each line.

So instead of the first line being 16,200.00 for the Gross weight, it should be 3920.00 (the Net weight plus the total weight of the containers which will come from a UDF I made).

Can I do what I'm attempting?

  • 0

    Try a running total, evaluated on change of group... (choosing the group to use carefully... something like line key...).. reset on change of group (order / invoice...).

    If you can't get that to work, you have to use a variable in multiple formula objects (placed properly in the report), which gets tricky to manage if you haven't used them before.

    whileprintingrecords;

    shared numbervar MyWeightValue;

    ...