Is it possible to set a filter programmatically for a DataItem in a report? I've used <dataitem>.setrange, <dataitem>.setfilter, passing a string with the desired filter. Each time I run the report, it appears to not have any filters at all!
Thx in advance.
Tim Lecander
ArcherPoint
0
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
1. OnPreDataItem
method: write code in this trigger to filter the recordset
advantage: quick and easy
disadvantage: no way to set the filter dynamically
2. custom function
method: create a function in your report to set the filter. Or at least the parameters to be used in method 1.
advantage: can set filters dynamically
disadvantage: you have to instantiate the report before you can set the filters
3. pass in filtered record
method: first set filters on recordset then call advantage: dynamic filtering wihtout having to instantiate the report first
disadvantage: you can only filter one table
correct me if I am wrong.
Thanks to all of you for the quick reply. I had been setting the filter only at OnPreReport, I didn't think :oops: of placing it in OnPreDataItem.
Thanks so much, all!
ArcherPoint