SSRS 2008 R2 - access entire dataset from custom code
Hi NG
I use the following expression on a report label. The parameter is a multi-valued parameter, that has it's visibility set to "internal". It has its available values set to the HMG dataset, with a valid value and label field. It also
has its default values set to read from the same dataset, ensuring that there is a list v values available.
=Join(Parameters!HeaderMediaGroups.Label, "/")
However, when the source dataset is empty, the paramtere does not have any data to load, and therefor prevents the report from loading.
I would like to ot use a parameter, but rather have a custom code function to loop through the dataset and return a delimited string for display. Something along these lines ...
Public Function MakeList(ByVal items As Object(), ByVal Sprtr As String) As String
If items Is Nothing Then
Return String.Empty
End If
Dim builder As System.Text.StringBuilder = New System.Text.StringBuilder()
Dim blnIsNew As Boolean = True
For Each item As Object In items
If item.ToString().Trim().Length > 0 Then
If Not blnIsNew Then builder.Append(Sprtr)
builder.Append(item)
blnIsNew = False
End If
Next
Return builder.ToString()
End FunctionRegards Des Norton
January 24th, 2011 4:30am