Defualt value for a report filter?

pedroccda
Member Posts: 90
Is it possible to set a defualt value for a report filter? At the moment I filter using a date range calculated using code (first day of month-last day of month), but I want make possible for end user to change this range.
Kiki
0
Comments
-
I didn't test this code, but you should be able to do this by calling the report like this:
recMyRecord.SETRANGE("Posting Date", datDateFilter); REPORT.RUNMODAL(intReportnumber,TRUE, TRUE, recMyRecord);
Basically, you have to filter a record-variable, and call the report, when passing this record variable to the report.
It's weekend now, and it's about 12:55 AM, and I'm working with Linux at the moment ... so I can't test or look up an example, but if this doesn't work ... just let me know, and I'll look it up on Monday ... :whistle:0 -
Waldo wrote:I didn't test this code, but you should be able to do this by calling the report like this:
recMyRecord.SETRANGE("Posting Date", datDateFilter); REPORT.RUNMODAL(intReportnumber,TRUE, TRUE, recMyRecord);
Basically, you have to filter a record-variable, and call the report, when passing this record variable to the report.
It's weekend now, and it's about 12:55 AM, and I'm working with Linux at the moment ... so I can't test or look up an example, but if this doesn't work ... just let me know, and I'll look it up on Monday ... :whistle:
I know this method...but I want to set a default value in the form that appear reporting field filter just before create a report... in this manner the user have yet a date range and if he want he can modify it.Kiki0 -
You mean on the request form of the report?
You could do this by creating a new function (eg, SetParameters) in the report, and calling this function before running the report (RUNMODAL), for exemple:repMyReport.SETPARAMETERS(datPostingDate); recMyReport.RUNMODAL;
0 -
Waldo wrote:You mean on the request form of the report?
You could do this by creating a new function (eg, SetParameters) in the report, and calling this function before running the report (RUNMODAL), for exemple:repMyReport.SETPARAMETERS(datPostingDate); recMyReport.RUNMODAL;
Ok, maybe I don't express my problem in a good way...
My problem is how can I set a default value for a filter on the request form of the report that appear at report run?? I want that my calculated date range appear as proposal instead of the last data range inserted by user.Kiki0 -
This works for running the Statement directly from the Customer Record via a menu:
<Control1000000095> - OnPush()
Cust.SETRANGE("No.","No.");
Cust.SETFILTER("Date Filter",'..%1',WORKDATE);
REPORT.RUN(REPORT::Statement,TRUE,FALSE,Cust);
Hope this helps.
ColinExperience is what you get when you hoped to get money0
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