Adding two fields using First Function

Stimulsoft Reports.NET discussion
Post Reply
lkucin
Posts: 4
Joined: Wed Dec 18, 2019 2:49 pm

Adding two fields using First Function

Post by lkucin »

I have 2 datasource that have the fields acct num, pay date, payment amount with different limited criteria.
I want to pull the first payment amount so I sorted the datasource by acct, date then did first(datasource.pay_date). Those all work fine for those 2 fields from each datasource.
But I now need another textbox that combines the two first payments from those two sources but I'm getting an error that it cannot turn an object into an int and asking me if I have forgotten a cast.

Is there a way around this?
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Adding two fields using First Function

Post by Lech Kulikowski »

Hello,

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

Thank you.
lkucin
Posts: 4
Joined: Wed Dec 18, 2019 2:49 pm

Re: Adding two fields using First Function

Post by lkucin »

we are locked down and unable to share. Can you tell me what format a field takes when you use the First function and if there is a way to convert that format?
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Adding two fields using First Function

Post by Lech Kulikowski »

Hello,

You can check it in the Dictionary:
object First (object expression)

You can use Parse methods - {Decimal.Parse(First(datasource.column).ToString())}

Thank you.
lkucin
Posts: 4
Joined: Wed Dec 18, 2019 2:49 pm

Re: Adding two fields using First Function

Post by lkucin »

I'm getting this error now
Attachments
exp.jpg
exp.jpg (28.82 KiB) Viewed 575 times
err.jpg
err.jpg (18.43 KiB) Viewed 575 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Adding two fields using First Function

Post by Lech Kulikowski »

Hello,

What product and version are you use?

Thank you.
Post Reply