I am designing a report with ILE table. To explain, I have 2 “Document No.” in ILE with its respective Lot No’s. Example,
Document No. Lot No. Quantity
A-111 AA 10
A-111 AA 20
A-111 BB 10
D-555 DD 30
D-555 DD 40
G-777 GG 40
G-777 GG 10
G-777 GG 30
Here the Document 1 has different lots and 2 & 3 have the same lots. So if I run the report the output should consider only the Document Nos which has only single lot and sum up the quantity.So the output wud be,
D-555 70
G-777 80
I tried with this code, placing it in the GroupFooter of ILE,
recILE.RESET;
recILE.SETRANGE(recILE.“Document No.”,“Item Ledger Entry”.“Document No.”);
recILE.SETFILTER(recILE.“Item Category Code”,‘CB’);
recILE.SETRANGE(recILE.“Entry Type”,recILE.“Entry Type” :: Consumption);
IF recILE.FINDSET THEN
REPEAT
PrevLotNo := recILE.“Lot No.”;
IF PrevLotNo = recILE.“Lot No.” THEN
LotQty += recILE.Quantity;
UNTIL recILE.NEXT = 0;
But with this its considering the first document also. Can anyone help me with this…
recILE.SETCURRENTKEY(“Document No.”,“Lot No.”); // You need a key with Document No and Lot No.
recILE.SETRANGE(recILE.“Document No.”,“Item Ledger Entry”.“Document No.”);
recILE.SETFILTER(recILE.“Item Category Code”,‘CB’);
recILE.SETRANGE(recILE.“Entry Type”,recILE.“Entry Type” :: Consumption);
IF recILE.FINDSET THEN
REPEAT
IF ((PrevLotNo = recILE.“Lot No.”) OR (PrevLotNo <> ‘’)) THEN BEGIN
PrevLotNo = recILE.“Lot No.”;
LotQty += recILE.Quantity;
END ELSE
CurrReport.SHOWOUTPUT(FALSE);
UNTIL recILE.NEXT = 0;
You should do the grouping on Document No.,Lot No. in groupheader of “Lot No.” appply counter & if counter is more than 1 then CurrReport.SHOWOUTPUT(FALSE)