RDD Making Duplicate Lines

Hello!

I am working on a Bartender label, but having issues with the data. I took the original PackSlip and brought SerialNo out with a relationship to ShipDtl using PackNum and PackLine and Company.

But it’s creating an issue where instead of 9 labels, it doubles it by making 18. In this particular example, there should only be 9 serial numbers populating.

What can I do to fix this?

Make sure the relationship is correct. I had a recent case where I added the PartPlant table to provide site specific information but forgot apply a criteria to said table it provided duplicate records for each part at each site the person had access to.

Most likely cause is a missing piece of your join or criteria to limit to appropriate record links.

Can you go into more detail of how you fixed it?

Yes, I added a criteria to plant in PartPlant linked to another table’s value for mine.

Not quite enough information to guide you from your OP… Details matter :slight_smile:

Apologies.

I am not sure I can add a Criteria. This is a copy of PackSlip, and when I try to do New Table Criteria it rejects me by saying “Criteria cannot be added to System Defined Report Tables.”

Attached is the RDD.: RDDPSCR8Test.xml (1.9 MB)

When I make a BAQ that joins ShipDtl and SerialNo, I only get the 9 entries I want. There must be another join in here that is causing the duplicates?

Show your datasources list please.

That looks like the original PS set mostly and the RDL how did you change that for bartender to use? Or rather how are you generating your output for bartender?

CustXPrt was added/given a relationship and SerialNo was given a relationship. Both to shipDtl.

Plus some un-excluding, but otherwise that is it. It works fine aside from printing double. And when you look at the Record Browser in Bartender, you’ll see double/18 entries for this particular slip I am testing.

Right now we’re just testing/building and seeing what we can do. We take the .bt file that the report generates when run and we use that.

So, the original dataset already creates 2 row per one PackLine can generate multiple serial numbers. Looking at our dataset expression for ShipHeadShipDtl, the relationship you are adding is not required. Our dataset does produce 2 records per packslip line with the only difference is a null vs 0 for column AttributSetID. One for the PackSlip and one for the Shipping Label.

="SELECT  ... ALL THE COLUMNS WE NEED ...
 FROM ShipHead_" + Parameters!TableGuid.Value + " T1
 LEFT OUTER JOIN ShipDtl_" + Parameters!TableGuid.Value + " T2
  ON T1.Company = T2.Company AND T1.PackNum = T2.PackNum
 LEFT OUTER JOIN RptLabels_" + Parameters!TableGuid.Value + " T3
  ON T1.RptLanguageID = T3.RptLanguageID 
 LEFT OUTER JOIN SerialNo_" + Parameters!TableGuid.Value + " SN
  ON T2.Company = SN.Company AND T2.PartNum = SN.PartNum AND T2.PackNum = SN.PackNum AND T2.PackLine = SN.PackLine"

You should not need the relationship you are creating as the data will be there if not excluded.
Did you only list the single ShippingLabel or Just the PackSlip or both?
Here is our PrintProgram field: reports/CustomReports/PackingSlip/PackSlip,reports/CustomReports/ShippingLabels/ShipLabl

I am just using PackSlip.

Is there a way to make it so it only does 1 per row?

Edit: The reason I don’t use the serial number field already in there is that it is calculated and just lists all the serial numbers in one go. I need a label for each serial number.

Kinda built into the default RDD AFAIK.

You could change the Query in the RDL to add a where condition to end of query pretty sure this would work if you setup like I have shown above…

... 
WHERE SN.AttributeSetID IS NOT NULL

This would require rework of the RDL groupings from PackNum to SN I would think. That way you generate a separate one for each SN vs PackNum.

Where does the .rdl come in? We have it set up so it drops a .bt file and we use that. I do not think we are incorporating an actual .rdl file.

RDL is your report builder report style. I listed above under the PrintProgram field in report style.

You can also do something like this


LEFT OUTER JOIN (
    SELECT 
        Temp4.Company, 
        Temp4.PackNum, 
        Temp4.PackLine, 
        Temp5.Description AS CountryDescription,
        ROW_NUMBER() OVER (PARTITION BY Temp4.Company, Temp4.PackNum, Temp4.PackLine ORDER BY Temp4.PackLine ASC) AS RowNum
    FROM ShipCOO_" + Parameters!TableGuid.Value + " Temp4
    INNER JOIN Country_" + Parameters!TableGuid.Value + " Temp5 
        ON Temp4.Company = Temp5.Company AND Temp4.OrigCountry = Temp5.CountryNum
    WHERE Temp4.RelatedToFile = 'ShipDtl'
) A8
 ON T2.Company = A8.Company AND T2.PackNum = A8.PackNum AND T2.PackLine = A8.PackLine
 AND A8.RowNum = 1"

I do this for the COO.

 FROM ShipHead_" + Parameters!TableGuid.Value + " T1
 LEFT OUTER JOIN ShipDtl_" + Parameters!TableGuid.Value + " T2
  ON T1.Company = T2.Company AND T1.PackNum = T2.PackNum
 LEFT OUTER JOIN RptLabels_" + Parameters!TableGuid.Value + " T3
  ON T1.RptLanguageID = T3.RptLanguageID 
 LEFT OUTER JOIN SerialNo_" + Parameters!TableGuid.Value + " SN
  ON T2.Company = SN.Company AND T2.PartNum = SN.PartNum AND T2.PackNum = SN.PackNum AND T2.PackLine = SN.PackLine
WHERE SN.AttributeSetID IS NOT NULL"

Something like this then?

1 Like

Hmm…

How are you integrating the .rdl with Bartender? The way we have it set up right now/was taught to us, we don’t utilize .rdl for this.

I was more talking about the RDD part of this. You said you started with the PackSlip RDD. My apologies, I’m not sure what the translation part for Bartender is, but my assumption is that it would use a similar method to consume the dataset to a rdl. I would be the wrong person to answer that question as we don’t employ that integration within our Epicor environment.

Perhaps if you share how you were taught to grab the dataset within Bartender I might assist you or another perhaps @Chris_Conn I think he is the Bartender guru here.

Looking back, I should have read more clearly. Why not use a BAQ to generate your dataset then as it seems you were getting what you wanted with one?

As I said, I do not use Bartender so I am unaware of the way the integration works within Epicor, but why not use what you know works and just create a BAQ RDD for your Bartender purpose?