How to delete filters in report everytime?

Aravindh_Navision
Member Posts: 258
Hi Friends,
I have a doubt in report. I just wanted to delete the previous filters given while running a report every time automatically. I need to do this without deleting the ZUP file.
Thanks in advance,
Aravindh
I have a doubt in report. I just wanted to delete the previous filters given while running a report every time automatically. I need to do this without deleting the ZUP file.
Thanks in advance,
Aravindh
0
Answers
-
Set SaveValues property to No in Request Form of report.0
-
Thanks Mohana for your reply. When I set the property SaveValues to NO, the filter in the Request Form only gets disappeared. How to delete the filter in dataitem.
Aravindh.0 -
There is no way to clear dataitem filters IMO.
You can redesign your report by moving all dataitem ReqFilterFields to Request Form0 -
Use a seperate codeunit instead of the same singleinstance codeunit that the NAS is using. (according to your choice of word "automatic")
If you don't clear your variables, the system will remember them. And using a non single-instance codeunit with a codeunit.run statement = a codeunit with cleared variables.
This is rather basic stuff if you ask me...0 -
Thanks Sog for your tips. I need to delete the filters in G/L Register report. It contains 2 dataitem tabs G/L Register and G/L Entry.
Actually what I need to do is, while running the G/L Register report from Sales Journal's Post and Print option, when there is some filter in G/L Register, there is no problem in running the report. Suppose if I give some filter in the second tab i.e., in G/L Entry, the report is not printing from Post and Print option from Sales Journals.
Could you please tell me how to handle this?
Thanks,
Aravindh0 -
From what you say in your latest post I assume, that the report work correctly when you clear the filters in the request dialog.
If this is the case, the suggestion from mohana_cse06's first post in this thread will work. If not indeed, please explain what exactly makes you sayAravindh_Navision wrote:When I set the property SaveValues to NO, the filter in the Request Form only gets disappeared.
Another way you can tackle the issue is by using the SETTABLEVIEW function on the report before you run it. Some developers don't know, that you can use this for any dataitem (well, the first of every record type), not just the top level one.0 -
I have been working with all version of Navision since 2.6 and the G/L Register has always given me a problem. If someone manually reprints a G/L register the following Post and Print will NEVER produce any output ever again (from that PC and ZUP file) until the user goes back to the G/L register, clears all filters and then does a print preview. They can then escape as soon as the report initiates. Choice 2 is to go in recompile the G/L Register to clear the old filters. I have tried numerous coding changes but with no success. I have reported this to Microsoft and they say it is a known problem but no solution given. Happens also but less frequently with BOM and Item Register.0
-
The solution I programmed for a customer is rather simple.
In G/L Entry - OnPreDataItem put the following as the first lines:IF "G/L Register".GETFILTERS <> '' THEN BEGIN RESET; END;
With this piece of code Post & Print will always work. When Post&Print runs the CU will always place a filter for a Register No. so we can sefely delete the filters on G/L Entry.
Manual printing might create a problem:
If the User places a filter manually on the G/L Entry it works as long as the User does not place a filter on the G/L Register. If G/L Register is also filtered then the code will delete the addiitonal filter on G/L Entry. In this case you will need to tell the User to place a filter only on G/L Entry or on G/L Register but not both.
This solution works for the customer since several years and there were no complaints.
Edit:
If the User places a filter on another field in G/L Register aside from the Register No. you will have to modify the code. Users with my customer don't do that.Frank Dickschat
FD Consulting0 -
Thanks FDickschat. It worked.. :thumbsup:0
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