Page 1 of 1

Adding two fields using First Function

Posted: Thu Feb 02, 2023 10:19 pm
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?

Re: Adding two fields using First Function

Posted: Thu Feb 02, 2023 10:26 pm
by Lech Kulikowski
Hello,

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

Thank you.

Re: Adding two fields using First Function

Posted: Thu Feb 02, 2023 10:43 pm
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?

Re: Adding two fields using First Function

Posted: Fri Feb 03, 2023 8:36 am
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.

Re: Adding two fields using First Function

Posted: Fri Feb 03, 2023 1:40 pm
by lkucin
I'm getting this error now

Re: Adding two fields using First Function

Posted: Mon Feb 06, 2023 1:41 pm
by Lech Kulikowski
Hello,

What product and version are you use?

Thank you.