Date from user input into the mrt file

Stimulsoft Reports.NET discussion
Post Reply
Meda123
Posts: 1
Joined: Mon Jun 03, 2024 10:55 pm

Date from user input into the mrt file

Post by Meda123 »

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
Lech Kulikowski
Posts: 7333
Joined: Tue Mar 20, 2018 5:34 am

Re: Date from user input into the mrt file

Post by Lech Kulikowski »

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.
Post Reply