AddMonths

Stimulsoft Reports.NET discussion
Post Reply
Eric
Posts: 6
Joined: Sun Sep 03, 2017 1:57 pm

AddMonths

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: AddMonths

Post 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.
Eric
Posts: 6
Joined: Sun Sep 03, 2017 1:57 pm

Re: AddMonths

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: AddMonths

Post by Alex K. »

Hello,

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

Thank you.
Eric
Posts: 6
Joined: Sun Sep 03, 2017 1:57 pm

Re: AddMonths

Post by Eric »

Thank you.
I just think about intellisense without trying it.
I even once tried to use System.Convert.ToDateTime
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: AddMonths

Post by Alex K. »

Hello

Please let us know if you need any additional help.

Thank you.
Post Reply