Hello, I have designed a report including a request Form. On the Rf is a button which execute a function. In this function I would like to show a Graph which represents the data. If the user click the button I would like to set a filter which belongs to the settings the user make in the ‘normal Navision’ Filter Fields. My Question is now, how i could read the settings of the users filter, or if there is a function to set the filter like the users choice. Thanks for your help ! Rgds Chris
Hi Chris! When you are clicking the Button on the RF, are you then executing/processing the report or are you just running a kind of “sub function” and after that returning to the RF? When processing the report, you could use GETFILTER, GETFILTERS or maybe COPYFILTER and COPYFILTERS … otherwise you can not get the filtervalues on the “Standard RF” [B)] Maybe you have to create manually a form that looks like the “RF-Filter-Form” where values are entered in TextBoxes, - those you could check also before processing -, and then - when running the report - copy the “filter”-settings to the DataItem-record … !? Regards, Jörg
Another problem with filters in a report which I noticed recently is that the filters associated with a data item are available only after the data item has been “entered” during execution. For example, if you are running a report on your customers and, for each customer, the ledger entries, the filters on the ledger entries can be retrieved with GETFILTERS only after the OnPreDataitem trigger of the ledger data item has started executing. If you execute a Ledgers.GETFILTERS in e.g. the OnPreDataitem of the customer data item, an empty string is returned. This is quite an annoyance when you want to print the filters set by the user in a header section. Can somebody confirm this behavior?
This should not be the case. You can use Customer.GETFILTERS; in the trigger OnPreReport. That’s how the filter text is fetched in many standard reports. OnPreReport is triggered when You push Print or Preview and befor any DataItems has been “entered”. There are some good graphs showing this in the C/SIDE Developers Guide. //Lars
Hi Joerg, its just a ‘sub function’. So I think I’ve to create a Filter-Form manually… The problem I had when I tried to solve the problem with a manually create form, was that there are a lot of machines which the users would like to filter for. For instance if the user only need the data of machine 1, 4 ,5, in the Navision RF he could use the normal filter methods. I’ve thinked about a workaround, and tried to realize it with a List-Box. But Navision doesn’t support ListBoxes. Has anyone an idea ? Thanks for your help. Rgds Chris
Lars, I just tried it: In the OnPreReport trigger, all filters are available - just as you said. However, once processing of data items has started, the filters of nested data items are no longer available in the parent data item [B)] So it seems that one has to “pre-fetch” all needed filter expressions in OnPreReport and assign them to text vars…
Check this out… Create a text box at a Header with sourceExpr = Customer.GetFilter