Beantwortet Take the value from concern character SSRS

  • Wednesday, January 09, 2013 2:24 PM
     
     

    HI Experts, 

    I have small issue like this 

    Parameters!PropertyCodes.Label

    I was placing this in the expressions to know what are the parameters I have selected in the report.

    it is working fine 

    The names are like this    

    EVR-SRT-Hoursworkdone

    SRK-TG-Twohoursworkdone

    BJ-EXTRN-Fivehoursworkdone

    so my question is    I want to display then till where second "-" will end

    like this 

    EVR-SRT

    SRK-TG

    BJ-EXTRN

    How to write the expression for this.   I have tried left,MID but can not able to mention take till "-" symbol

    Any Idea please

All Replies

  • Wednesday, January 09, 2013 2:31 PM
     
     

    Hi,

    Use this expression:

    =Mid(Parameters!PropertyCodes.Label, 1, InStrRev(Parameters!PropertyCodes.Label, "-") - 1)


    Please mark as answered or vote helpful if this post help resolved your issue. Thanks!

    k r o o t z

  • Wednesday, January 09, 2013 2:51 PM
     
     

    I have tried this but it was giving an error 

    like

    The value expression for the textrun [BC30518] Overloaded resolution failed because no accessible 'Join'

    can be called with these arguments

    ="Property: " & JOIN(Mid(Parameters!PropertyCodes.Label, 1, InStrRev(Parameters!PropertyCodes.Label, "-") - 1),", ")

  • Wednesday, January 09, 2013 3:57 PM
     
     Answered Has Code

    Hi,

    You did not say it was a multi-value parameter.

    Add this to the code section of your report properties:

    Public Function FormatCodeStr(ByVal str As String) As String
    
    Dim arr as String()
    Dim code as String
    Dim retval as String
    
    arr = Split(str, ",")
    For each code in arr
       retval = retval & Mid(code, 1, InStrRev(code, "-") - 1) & ", "
    Next
    
    return Left(retval, Len(retval) - 2)
    
    End Function

    Then use the expression below to display the short version of the selected codes:

    ="Property: " & Code.FormatCodeStr(Join(Parameters!PropertyCodes.Label,","))


    Please mark as answered or vote helpful if this post help resolved your issue. Thanks!

    k r o o t z