How to use Split in Reporting Services.
How to use Split in Edit Expression of a table column using SQL Server Reporting Services.
Thanks
Shivaprakasha
December 18th, 2007 7:25am
Split("String_tobe_splited","_",3)
The above expression splits the string whenever it sees "_" and forms an array of string for "3" substrings.
While using this array, if you want first substring you can call as Split("String_tobe_splited","_",3)[0].
Let me know if its clear enough
Free Windows Admin Tool Kit Click here and download it now
December 18th, 2007 11:10am
Thanks for your replay,
I tried as u suggest, but it's not working,
Below is theway i have tried,
=Split(Fields!Recurrence_Pattern.Value.ToString(),",",1)
Actually in my report i am fetching the data from db, values will be as below
1
0
1,0
1,8/17/2008
1,10/16/2008,12/7/2008
in my report i have check for the values and i have to display the english description like, Daily, Weekly, Every 2 weeks on Saturday...
for this i need to split the values by "," then i have to check for each array values then according to the values i have to display discrition.
Is the split is the right method to use for this problem, if not suggest me any other ways.
Thanks in advance
Shivaprakasha
December 19th, 2007 12:31am
Round brackets and no square bracketsshould be used.If you want the first occurence of the array use :
=Split(Fields!Recurrence_Pattern.Value.ToString(),",")(0)
Grtz.
Free Windows Admin Tool Kit Click here and download it now
December 26th, 2007 5:07am
Hi ,
If you want the data to come separated with "," then you can write simple expression something like
=Fields1.value & "," & field2.value
this will give you the values to come with comma separated.
please tell me if i have misunderstood your question.
Anyway let me know if you get the solution
Thanks
Mahasweta
December 26th, 2007 5:54am
It's working now,
Thanks
Shivaprakasha
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2007 2:42am
=Replace(First(Fields!Reasons.Value.ToString()),",",vbCrLf & "-")
January 30th, 2008 1:14pm
When you don't know the exact amount of elements to split on. You can write a cusom function and then call it on the expression line Something like what is detailed below
=Code.AddCarriageReturns(Fields!Recurrence_Pattern.Value)
Public Function AddCarriageReturns(ByVal s As String) As String
Dim i As Integer
Dim aryTextFile() As String
Dim ReturnString As String
If s.Contains(",") Then
aryTextFile = s.Split(",")
For i = 0 To UBound(aryTextFile)
ReturnString = ReturnString & aryTextFile(i) & vbCrLf
Next i
Return ReturnString
Else
Return s
End If
End Function
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2009 3:55pm
Split(Fields!Recurrence_Pattern.Value.ToString(),",").getvalue(1) or .getvalue(0)
0 means . before value taken
1 means .after value taken
August 4th, 2012 12:54am


