Run Report with predefined filters

shyamraoo
Member Posts: 38
Hi,
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");
REPORT.RUN(10139,TRUE,FALSE,Item);
The problem is Item Category code filter has more than 10 chars, like this
<>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN
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
OK
I have able to run this report with this filter on the Request page directly, but how to handle this in code.
Can anybody help us on this.
Thanks,
Shyam Kumar N
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");
REPORT.RUN(10139,TRUE,FALSE,Item);
The problem is Item Category code filter has more than 10 chars, like this
<>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN
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
OK
I have able to run this report with this filter on the Request page directly, but how to handle this in code.
Can anybody help us on this.
Thanks,
Shyam Kumar N
Regards,
N.Shyam Kumar
N.Shyam Kumar
0
Best Answer
-
Hi,
Have you tried the follwing syntax (using SETFILTER and not SETRANGE) ?Item.SETFILTER("Item Category Code",'<>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN');
5
Answers
-
Hi,
Have you tried the follwing syntax (using SETFILTER and not SETRANGE) ?Item.SETFILTER("Item Category Code",'<>A1&<>A2&<>A3&<>A4&<>MA&<>MB&<>MF&<>EA&<>EE&<>EG&<>EH&<>EI&<>EK&<>EL&<>EU&<>EV&<>RP&<>CN');
5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions