Hi there,
I would like to programmatically set dates to particular templates.
eg. I'll create a UI which the user will be able to select a template report and when it will be run.
Say they select report1.mrt and want to have it run every month or every week.
Is it possible to pass this to the mrt file? I assume i could insert the From_Date and To_Date between the <value></value>?
Could you give me an example of how to write the From_Date and To_Date variable; which would be the first day of the current month and the last day of the current month?
My backend will obviously take care of running the reports, I just need help with altering the mrt files with whatever start and end dates i need.
Kind regards
Date from user input into the mrt file
-
- Posts: 7333
- Joined: Tue Mar 20, 2018 5:34 am
Re: Date from user input into the mrt file
Hello,
You can use the DateTime-Range variable and provide it value from the code.
> From_Date and To_Date variable; which would be the first day of the current month and the last day of the current month?
First day - DateSerial(Today.Year,Today.Month,1)
Last day - DateSerial(Today.Year, Today.Month, DaysInMonth(Today))
Thank you.
You can use the DateTime-Range variable and provide it value from the code.
> From_Date and To_Date variable; which would be the first day of the current month and the last day of the current month?
First day - DateSerial(Today.Year,Today.Month,1)
Last day - DateSerial(Today.Year, Today.Month, DaysInMonth(Today))
Thank you.