Report.run (reportid, true,false,tmptable) lost the filters in navision 2016

Hi Expert.

I got a strange pb.

 

my code is below:

l_tmprecSalesHdr.DELETEALL;
CurrPage.SETSELECTIONFILTER(l_Buffer);
IF l_Buffer.FIND('-') THEN
REPEAT
IF l_recSalesHdr.GET(l_recSalesHdr."Document Type"::Order,l_Buffer."Create Order No.") THEN BEGIN
IF NOT l_tmprecSalesHdr.GET(l_tmprecSalesHdr."Document Type"::Order,l_Buffer."Create Order No.") THEN BEGIN 
l_tmprecSalesHdr :=l_recSalesHdr;
l_tmprecSalesHdr.INSERT; 
MsgTxt := MsgTxt + l_Buffer."Create Order No."; 
END; 
END;
UNTIL l_Buffer.NEXT = 0;
REPORT.RUNMODAL(50008,TRUE,FALSE,l_tmprecSalesHdr);

 

I can not get the correct result. it shows the whold data report., in fact just should show only some records based on what I selected in a page.

any suggestion will be appreciated.

Related
Recommended