Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How do I strip special characters in SSRS for Lookup columns with Multiple Selections?

  Asked By: Alisha    Date: Jun 22    Category: Sharepoint    Views: 3666

I am building reports against my SharePoint List (actually a library). 1 of the columns I want to display in the report is a Lookup column that allows Multiple lookups. Problem is that the SharePoint Web Service call GetListItems returns the values with the item id and ";#" combination. For example:

122;#Apple;#112;#Carrot

but I need the following format:
Apple, Carrot

Following this great article posting - www.sharepointu.com/.../...repoint-list-redux.aspx

I was able to drop the first part using the following code

function GetNameFromSP(pFullID as string) as string


dim strRet as string
dim iPos as integer

if pFullID = nothing then return ""
if pFullID = "" then return ""
iPos = Instr(pFullID, ";")
if iPos < 1 then return pFullID

return Mid(pFullID, iPos +2)
end function

But it does not replace the subsquent id references.

Anyone done this before that can provide me tips?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Adya Deshmane     Answered On: Jun 22

Here is the updated code that resolves my issue (a coworker of mine provided the following code):


Function TrimMultiLookup(ByVal s As String) As String
Dim combStr As String
Dim array As String()
Dim c As Integer
combStr = String.Empty

array = Split(s, ";#")
Console.WriteLine(array.Length)
For c = 1 To array.Length - 1 Step 2
combStr += array(c) + ", "
Next

Return Left(combStr, combStr.Length - 2)

End Function

 




Tagged: