Filtering in report

Hi,

I am preparing a report using Production BOM Line table. I want the report to filter on date, but we dont have any date fields in Production BOM table. I have created a variable of Item table in Production BOM table. I want the report to fiter on Date Filter field of Item table. I have used,

recItem.RESET;
recItem.SETRANGE(recItem.“No.”,“Production BOM Line”.“No.”);
recItem.SETFILTER(recItem.Inventory,’<>%1’,0);
recItem.SETFILTER(recItem.“Date Filter”,’%1…%2’,StartDate,EndDate);
.
.
.

I have used the StartDate and EndDate variables in request form. But the report is not filtering based on the Date Filter field of Item table. Can anyone help me out.

I have used this code in Production BOM Line-OnAfterGetRecord().

Inventory is a flow Field…

You shd use CALCFIELD before using it

Ya I have done that, but my issue is about filtering by date.

What is the purpose of the report? The code you are trying will not work and even if it works then it will be a performance killer. You need some alternative way and a little details of the requirement will help.

Try to debug when you reach there to filter and you can surely get the right idea. And even check for values of Date Filter you are using when you run your report.