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…