Question:
How can I create a monthly report with filters related to the previous month (from 05/01 to 05/31, for example)?
Solution:
To do so, use a timer tag set up as 3-ttMonthly, with its StartTime parameter set up as the date when the OnPreset event must be fired, as seen below:
At the OnPreset event, create a logic that sends the initial and final dates to the reports filters, as well as the action that must be deployed after the filter is over.
For this, the script will check the month and the year when the Preset event is taking place, and also in which month the report is being requested. After this, the initial and final dates to be presented by the report will be sent to the query via scripts.
Attached to this article is a demo application that illustrates how this script works.