I am wanting to set 2 parameter values to the start of the previous month and the last day of the previous month
Can I build a new date in an expression? Something like = new Date(Today().year, Today().Month, 1).AddMonths(-1)
3 Answers, 1 is accepted
0
Chavdar
Telerik team
answered on 16 May 2013, 08:38 AM
Hello,
You can achieve your goal by using the Date and Time functions available in our expressions. For example, to set the default value to previous month you can use the following expression:
= Today().AddMonths(-1)
If generating the desired date requires more complex logic you can use an user function which returns the correct value.
Hope this helps.
Kind regards,
Chavdar
the Telerik team
Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.
So to get the first and last dates of the previous month we could do something like
= (Today().AddDays(1-Today().Day)).AddMonths(-1)
?
1
Chavdar
Telerik team
answered on 16 May 2013, 03:52 PM
Hello,
Your expression is almost the correct one as it misses the cast to double for the AddDaysmethod call. To get the first day of the previous month you can use the following expression: