Get filter information from request form
Sapphire123
Member Posts: 112
Hi All,
what function do i use to extract the filter value from a request form of a report?
thanks.
what function do i use to extract the filter value from a request form of a report?
thanks.
0
Answers
-
-
It depends on WHEN you want them. You cannot read them before the report is printed/previewed. All filters can be read in PreReport trigger, and after that you can read fitlers in PreDataItem and other DataItem triggers, but just for the actual DataItem or any Parent DataItem. You cannot read filters for nested dataitems...Sapphire123 wrote:Hi All,
what function do i use to extract the filter value from a request form of a report?
thanks.0 -
If you are adjusting the filters for your report on the RequestOptionsForm I go about it this way...
Set global variable(s) to the DataItem(s) your RequestOptionsForm will apply to.
Every control on the form calls a function I make (something like "UpdateFilters" or what have you) and it appears like this:UpdateFilters() globalRecordvar.RESET; globalRecordvar := DataItemRecord; //Apply all filters according to what is enabled/has value //...this I have on every RequestOptionsForm and I find it to be rather informative as well as "nifty"... IF globalRecordvar.ISEMPTY THEN gRecordCount := 0 ELSE gRecordCount := globalRecordvar.COUNT;
(I have a textbox which shows the value of gRecordCount letting the e/u know how many records there are with the current filter(s) applied.)
To apply the filters...DataItemRecord - OnPreDataItem() COPYFILTERS(globalRecordvar); //Copy filters from record variable used in RequestOptionsForm
0 -
can someone pls post an example?
i'm trying to get filters in predataitem of a report.
how do i use 'getfilters' function?
thanks in advance for your help..0 -
Just read the online help for the GETFILTERS, there is example... ;-)GETFILTERS (Record)
Use this function to return a string which contains a list of the filters within the current filter group for all fields in a record. In addition, this function also returns the state of MARKEDONLY.
String := Record.GETFILTERS
String
Data type: text constant or code
This string contains a list of the filters for all fields in Record.
Record
Data type: record
The record from which you want a list of filters.
Comments
See also GETFILTER, SETFILTER, and SETRANGE.
Example
This example shows how to use the GETFILTERS function.
"Cust. Ledger Entry".SETRANGE(Amount, -100, 100);
"Cust. Ledger Entry".SETRANGE(Date, 010196D, 123196D);
Str := "Cust. Ledger Entry".GETFILTERS;
MESSAGE(Text000 + '%1', Str);
Create the following text constant in the C/AL Globals window:
Text Constant
ENU Value
Text000
'The filters are:\'
The system displays this message:
The filters are:
Amount: -100..100, Date: 010196..123196-1 -
you can look at reports like Aged A/R 10040
go to the last dataitem - on the blank line under the last dataitem put your cursor & hit F9
You'll see
**Get Your Filters
OnPreReport()FilterString := COPYSTR(Customer.GETFILTERS,1,MAXSTRLEN(FilterString));
**Show Your Filters
Now when you view the sections you'll see a textbox with properties of:Customer.TABLECAPTION + ': ' + FilterString
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
