Issue in a report

Hi,

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

  1. A-111 AA 10

A-111 AA 20

A-111 BB 10

  1. D-555 DD 30

D-555 DD 40

  1. 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…

Thanks in advance…

Hi,

And you are grouping on which fields?

Grouping on “Document No” field.

Try

PrevLotNo := ‘’;

recILE.RESET;

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;

Tried with this code Mohan, now its not generating for the documents which has same lot also…

Hi,

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)

Change

IF ((PrevLotNo = recILE.“Lot No.”) OR (PrevLotNo <> ‘’)) THEN BEGIN

To

IF ((PrevLotNo = recILE.“Lot No.”) OR (PrevLotNo = ‘’)) THEN BEGIN

You should atleast try what is happening and why it is not working…

Ya… thanks… the issue was with the SETFILTER, its workin fine now.