This is a migrated thread and some comments may be shown as answers.

Why does this Iff() fail for my reporting form when using Last()?

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Heath
Top achievements
Rank 1
Heath asked on 02 Dec 2014, 03:08 PM
I have winforms application using telerik reporting. I have it connected to my database. I am always getting false for the following check in my group footer:

Problem

= IIf(Last(Fields.AllActivityLog_Purpose) In ('Remove [-]', 'Remove [-All]'), "true", "false")

 Always returns "false". This is absurd?


Sanity Check 1:  

=Last(Fields.AllActivityLog_Purpose)

it comes up as 'Remove [-]'.

Sanity Check 2:

=Len(Last(Fields.AllActivityLog_Purpose))
=Len('Remove [-]')

I get 12 for the first result and 11 for the second result.

Sanity Check 3:

=StringCompare(Last(Fields.AllActivityLog_Purpose), 'Remove [-]') returns 1 

Help

How can I get the Last(Fields.ActivityLog_Purpose) to pass it's check?
 

 

1 Answer, 1 is accepted

Sort by
0
Hinata
Top achievements
Rank 1
answered on 05 Dec 2014, 08:08 AM
Hi Heath,

I just tested the =Len('Remove [-]') in a TextBox item in Telerik Reporting and it returns 10. Not 11 or 12.
Actually, if you manually count the characters in that string you will find out there are 10 characters.
So that leads me to believe the problem is not in Telerik Reporting. Check your data once again for extra blank spaces or other special characters and if you still need help from the community you may want to provide more information like sample data or report.
Tags
General Discussions
Asked by
Heath
Top achievements
Rank 1
Answers by
Hinata
Top achievements
Rank 1
Share this question
or