Page 1 of 1

AddMonths

Posted: Thu Dec 21, 2017 10:11 am
by Eric
Hi all,

How to add months to a field based on other field (datetime)?
In FastReport, this can be done with : AddMonths([Field],n).
But in stimulsoft there seem no AddMonths function.

Re: AddMonths

Posted: Thu Dec 21, 2017 2:40 pm
by Alex K.
Hello,

In the NET products you can use any .NET functions:
YourDateTimeValue.AddMonths(Int32)

https://msdn.microsoft.com/en-us/librar ... .110).aspx

Thank you.

Re: AddMonths

Posted: Thu Dec 21, 2017 3:08 pm
by Eric
Thanks for the reply Alex K.
And where do i put this code? in an expression?

I tried using Expression :
{invoice.invDate} and from intellisense, the options are alias, name, nameinsource, and type.

Re: AddMonths

Posted: Thu Dec 21, 2017 3:20 pm
by Alex K.
Hello,

Please check the following expression:
{invoice.invDate.AddMonths(1)}

Thank you.

Re: AddMonths

Posted: Thu Dec 21, 2017 3:26 pm
by Eric
Thank you.
I just think about intellisense without trying it.
I even once tried to use System.Convert.ToDateTime

Re: AddMonths

Posted: Thu Dec 21, 2017 6:25 pm
by Alex K.
Hello

Please let us know if you need any additional help.

Thank you.