Report Issue

Hi,

A report called Packing List is developed from the tables “Packing List Header” and Packing List Line". The main table used in this report is “Packing List Package Details”(recPLPD) which is taken as a record variable. Calculations happen with the “Packing List Line” table and recPLPD table. The report sets range with the ‘Item No.’ of these tables. If the same item is present 2 times in “Packing List Line” table the report is doing the calculations for 2 times. We want that to do it only for single time. The code is written in “Packing List Line” group footer.

NetWt := 0;
GrossWt := 0;
TotalQty := 0;
recPLL.RESET;
recPLL.SETRANGE(“Document No.”,“Document No.”);
recPLL.SETRANGE(“Report Group ID”,“Report Group ID”);
IF recPLL.FINDFIRST THEN
REPEAT
recPLPD.RESET;
recPLPD.SETRANGE(“Packing List No.”,“Document No.”);
recPLPD.SETRANGE(“Item No.”,recPLL.“No.”);
IF recPLPD.FINDFIRST THEN BEGIN
NetWt := (recPLPD.“Net Wght. per Case”);
GrossWt := (recPLPD.“Gross Wght. per Case”);
TotalQty := recPLPD.Difference;

TotalNetWt += (recPLPD.“Net Wght. per Case”* TotalQty);
TotalGrosswt += (recPLPD.“Gross Wght. per Case”*TotalQty);
NetWtCarton := TotalNetWt + “Packing List Header”.“Net Weight”;
GrossWtCarton := TotalGrosswt + “Packing List Header”.“Gross Weight”;

END;
UNTIL recPLL.NEXT =0;

recPLL = Packing List Line , recPLPD = Packing List Package Details

Can anyone help me out with is…

dont you have Line No. in “Packing List Package Details”(recPLPD) table?

Ya we have it…

check whether that Line No. is equal to Packing List Line.“Line No”

If yes, you can filter on Line No. also…

Ok… wil try with it n get back to you…

Thank u :slight_smile:

Hey we have the Line No. field in both the tables. But the issue is they do not match, so I think it doesn’t work if I go with Line No…

BTW, the grouping is on which table and field?

Grouping is on “Packing List Line” table with ‘Report Group ID’ field.

recPLL.RESET;
recPLL.SETRANGE(“Document No.”,“Document No.”);
recPLL.SETRANGE(“Report Group ID”,“Report Group ID”);
IF recPLL.FINDFIRST THEN

Add Item no filter and try.

if it does not work, better you group on Item No also…

‘Report Group ID’ field is already taken as i have sent you in the code. I tried with adding Item No. also for the grouping, but its giving entirely different values…