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

2 posts, 0 answers
  1. Heath
    Heath avatar
    6 posts
    Member since:
    Oct 2014

    Posted 02 Dec 2014 Link to this post

    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?
     

     

  2. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 05 Dec 2014 in reply to Heath Link to this post

    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.
Back to Top