Iterate through rows of dataset in report's custom code

The ideal is to "transform" the data set into a multivalued parameter (or if you need several fields, transform it in multiple multivalued parameters).

The multivalued Report Parameter must have the following characteristics:

Hidden = True

Allow Multiple Values = True

Available Values tab:

Chose the desired dataset. Select the searchable id as Value id, and the field you want to expose as Label Field.

Default Values Tab - Get Values from a Query.

Choose the same Dataset as choosen in the available Values Tab.

Value Field the same you choose for value id.

Set the parameter to never refresh (or it will be loading the data from each iteraction of another parameter).

Now, the idea is make this Parameter "searchable". From this point you exposed the Dataset as an array in the Multi valued Parameter.

Now in a custom code insert the following code:

function GetDataSetLabelFromValue( id as integer) as String

dim i as integer

i = 0

for i = 1 to Report.Parameters!YourParameter.Count()

if Report.Parameters!YourParameter.Value(i) = id then

GetDataSetLabelFromValue = Report.YourParameter!ReportParameter1.Label(i)

Exit For

End if

next i

End Function