Run Report with predefined filters


I want to run the inventory valuation report with predefined filters, i have created a table to store the filters of the report then created list page and kept one action button, which calls report with predefined report filters.

Item.SETRANGE(“Item Category Code”,“Item Category Code”);
Item.SETRANGE(“Inventory Posting Group”,“Inventory Posting Group”);
Item.SETRANGE(“Replenishment System”,“Replenishment System”);

The problem is Item Category code filter has more than 10 chars, like this


when i call the report i stuck with this error message

Microsoft Dynamics NAV

The length of the string is 89, but it must be less than or equal to 10 characters. Value: <>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN


Could anyone know how to handle this.


Shyam Kumar N

Setfiler works

Do you got the solution

Hi Shyam,

This very Peculiar situation . if i understood Correct then you want to Sort for Some Option and eliminate Some Other .
if your Filter want only 10 Fields Use Pipe Filter Like SETFILTER(Field,1|2|3|4|5|6|7|8|9|10); instead of SETFILTER(Field,’<>11&<>12&…30);
As these are option Fields If you Want only First 10 filter in Option String
Then You Can use Like SETRANGE(field,1,10);

Or Selective filter like SETFILTER(Field,1|3|5|6|9|13|19|21);