How to delete filters in report everytime?

Aravindh_NavisionAravindh_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

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Set SaveValues property to No in Request Form of report.
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    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.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    There is no way to clear dataitem filters IMO.

    You can redesign your report by moving all dataitem ReqFilterFields to Request Form
  • SogSog Member Posts: 1,023
    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...
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    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,
    Aravindh
  • vaprogvaprog Member Posts: 1,141
    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 say
    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.
  • since2002since2002 Member Posts: 25
    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.
  • FDickschatFDickschat Member Posts: 380
    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 Consulting
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Thanks FDickschat. It worked.. :thumbsup:
Sign In or Register to comment.