SSRS Sales Order Pick List (SOPick) Duplicating Lines when printing multiples

So I set up some automated printing for Order Pick Lists. I have a function that checks for any new fulfillments to picking based on the timestamp, then it builds an order list (this is a report parameter), and sends them to print. It works great EXCEPT…

I had users complaining that it would print multiple, identical lines sometimes. They sent me some examples, and I printed both reports, and they looked fine. I had them send me pictures, and sure enough, there were dupe lines, and it looked different than what I was printing.

After messing around with it for way too long, I discovered that A) If I print multiple orders in the same print job:

And B) any of the orders have the an PartAlloc record with the same part and bin as another report:

It duplicates the rows.

I confirmed sending the report as CSV, and sure enough, if I send order 350150, it’s fine, single row. If I send order 350257, same thing, looks great. If I send both at the same time, though… dupes:

I’m not sure where to go with this. I’m pretty sure my query in the report itself is good, and the RDD seems to be correct. Any advice? Happy to share any other info that might help.

2 Likes

How is your SSRS report grouped?

Page > OrderNum > OrderLine

1 Like

Post the joins in the RDL

 FROM OrderHed_" + Parameters!TableGuid.Value + " T1
 LEFT OUTER JOIN OrderDtl_" + Parameters!TableGuid.Value + " T2
     ON T1.Company  = T2.Company 
    AND T1.OrderNum = T2.OrderNum
 LEFT OUTER JOIN OrderRel_" + Parameters!TableGuid.Value + " T3
     ON T2.Company   = T3.Company 
    AND T2.OrderNum  = T3.OrderNum 
    AND T2.OrderLine = T3.OrderLine
 LEFT OUTER JOIN JobProd_" + Parameters!TableGuid.Value + " T4
     ON T3.Company     = T4.Company 
    AND T3.OrderNum    = T4.OrderNum 
    AND T3.OrderLine   = T4.OrderLine 
    AND T3.OrderRelNum = T4.OrderRelNum
 LEFT OUTER JOIN RptLabels_" + Parameters!TableGuid.Value + " T5
     ON T1.RptLanguageID = T5.RptLanguageID 
 LEFT OUTER JOIN Customer_" + Parameters!TableGuid.Value + " CUS
     ON T1.Company = CUS.Company 
    AND T1.CustNum = CUS.CustNum 
 LEFT OUTER JOIN ShipTo_" + Parameters!TableGuid.Value + " STO   
     ON T1.Company   = STO.Company 
    AND T1.CustNum   = STO.CustNum 
    AND T1.ShipToNum = STO.ShipToNum
 JOIN (
        SELECT DISTINCT Company, OrderNum, OrderLine, OrderRelNum, PickingQty, PartNum, DimCode, BinNum 
        FROM PartAlloc_" + Parameters!TableGuid.Value + " 
        WHERE PickingQty > 0
    ) PA 
     ON T3.Company   = PA.Company 
    AND T3.OrderNum  = PA.OrderNum
    AND T3.OrderLine = PA.OrderLine
    AND T3.OrderRelNum  = PA.OrderRelNum
 LEFT OUTER JOIN (
        SELECT Company, PartNum, NetWeight FROM Part_" + Parameters!TableGuid.Value + "
    ) PARTS 
     ON PARTS.Company = PA.Company 
    AND PARTS.PartNum = PA.PartNum 
 LEFT OUTER JOIN WhseBin_" + Parameters!TableGuid.Value + " WB
     ON PA.Company = WB.Company
    AND PA.BinNum  = WB.BinNum

The SELECT DISTICT on PartAlloc is one thing I tried to fix it. Previously was just a join to PartAlloc.

That’s not going to work because you have 2 orders/lines.

Two orders and 30+ lines. There are lines on each two that have the same PartNum / BinNum in PartAlloc as on the other order (different line numbers).

What data are you getting from WhseBin?

Just the Bin Sequence.

Take that out and see what happens.

Dang, no luck. Same result.

Sorry, did you take the join out too? Comment out the whole join

I just removed it (and the related field and sort selection).

Now take out the Part table. Keep on working your way up until you find what is duplicating it.

Also, is that part a sub report? Check that you are sending the right parameters if it is.

@jkane @dr_dan Well this is embarrassing. I had added an additional Tablix for some of the PartAlloc rows, and didn’t add a “GroupBy” statement on the details group of the table. Adding Grouping on Bin and OrderNum solved my problem. Thank you both for all the help!

4 Likes

We’ve all been there

3 Likes