using Sum with a custom valuetype

Stimulsoft Reports.NET discussion
Post Reply
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

using Sum with a custom valuetype

Post by ivar »

Hello,

I have a custom valuetype that is implicit castable to a decimal and a double.

When used in a report in interpretation mode it is not possible to do any calculations with it.
I like to be able to do simple math with it like {obj1 + obj2}

Is this possible?

Regards, Ivar
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: using Sum with a custom valuetype

Post by Lech Kulikowski »

Hello,

It should work.
Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

Re: using Sum with a custom valuetype

Post by ivar »

I'll have to put some things together to create a proper sample. I get back to you.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

Re: using Sum with a custom valuetype

Post by ivar »

I created a sample that shows the problem.
The operators.png shows that the type has operators available to do math.
The 'can be casted.png' shows that the type can be casted to a decimal/double.
The 'Errormessage.png' shows the error I get.

The preferred solution would be that Stimulsoft uses the operators and could sum Money with Money.
A less preferred solution would be that Stimulsoft casts the Money to a decimal and does the math with that.

Thanks!
Attachments
StimulsoftValueType.zip
(78.16 KiB) Downloaded 144 times
Operators.png
Operators.png (5.37 KiB) Viewed 2014 times
ErrorMessage.png
ErrorMessage.png (59.26 KiB) Viewed 2014 times
Can be casted.png
Can be casted.png (2.19 KiB) Viewed 2014 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: using Sum with a custom valuetype

Post by HighAley »

Hello.

We have made an improvement.
Your code will work as expected with our next build.

Thank you.
ivar
Posts: 21
Joined: Tue Aug 04, 2015 11:41 am

Re: using Sum with a custom valuetype

Post by ivar »

Thanks! Much appreciated.

A question: Will it use the operators or will it cast to decimal?
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: using Sum with a custom valuetype

Post by Lech Kulikowski »

Hello,

Is used a cast to decimal.

Thank you.
Post Reply