Why standard filter is not working in Report AX 2009 ?

I added one field, itemid in Report ->data sources->Range->

So when i am selecting any itemid in lookup in dialog field my report is not getting filtered ?

I can’t go adding range in fetch() for itemid as i may select multiple fields by select button in dialog box…and this is standard.

I can’t understand why this itemid is not working ?

Any way in fetch() the code is as follows:

{

queryRun = new QueryRun(this);

if (!queryRun.prompt())

{

return false;

}

while (queryRun.next())

{

reportTable= queryRun.get(tablenum(ReportTable));

while select reportTableorder by reportTable.Date

where reportTable.Date >= fromDate && reportTable.Date <= toDate

{

if(! element.send(reportTable))

{

return true;

}

}

}

return true;

}

hi ,

you table (datasource should have the relation with the item id ) field.

Hi Srikanth,

First of all thanks buddy but my report is having only table.Then how can i add relation in data source if relation node itself is not there.

And Second thing is, in case it works by adding relation then for each field what iselect in filter i have to add relation ? No way ,Never…

From the query it seems that the reportTable is your report data source, why again you need this while loop when actually the while (queryRun.next()) loops through the query filtered records. It should be removed and ranges on date need to be added before queryRun.next()

The while loop is the issue as you are looping through the same table records which is not considering the filter applied to the query

i just modified the code and now my report is getting filtered.

// while select reportTableorder by reportTable.Date

// where reportTable.Date >= fromDate && reportTable.Date <= toDate

// {

// if(! element.send(reportTable))

// {

// return true;

// }

// }

ReportTable _reportTable; // Taken one more new object for reportTable

select _reportTable where _reportTable.RecId == reportTable.RecId;

if((_reportTable.Date >= fromDate) && (_reportTable.Date <= toDate))

{

element.send(reportTable);

}