I've posted this on Microsoft's Partner forum and never go a response, so I thought I'd try my luck here.
My question is not how to schedule a report, or how to schedule a report to run every day. I understand how to use the Schedule option, and the Job queue to set up a recurrence.
What I want to do is run the Daily Invoicing Report every day, with the current day's date at the date filter. So today is the 11th, to when I run the report today, date filter is 11. When I run it tomorrow, date filter is the 12th. I don't want to have to change the filter everyday. I want/should be able to set up recurrences for a report and then have the report update daily. I know if pages there are functions like %WORKDATE and %TODAY, but they don't appear to work with reports. I can enter it, but once I close the record, it loses the function and is just a standard date. any ideas?
0
Answers
https://navug.com/blogs/jason-wilder/2015/04/07/jays-nav-stuff
You'd need a bit more effort here to parse the expression (which could be more complicated) and evaluate date formula expressions to each part of the filter expression but again it's something that Is achievable. And once you've done it once you just put the main code in a codeunit which you can call for any reports that need the functionality.
1) Create a Text variable to hold your date filter expression
2) Add it to the Request page
3) In the OnPreDataItem trigger add code to apply the filter e.g.
You can now enter complex filter expressions and it evaluates perfectly, I tried something a bit silly to test... e.g. TODAY..%CM%|WORKDATE..%+1M%
As the filter expression is evaluated at the time it is run it will update as required.