If you have a query based report, you can try the following solution. It should work with RDP based reports as well :
Step 1 : In VS, manually add a Parameter(ReportFilterCriteria) to the report [Allow blank = True, Data type = String, Visibility = Hidden, Nullable = True]
Step 2 : Add a method to iterate through the ranges and return a concatenated string
private str getRanges(Query _query)
{
str rangeValue;
str queryRange;
int rangeCounter;
QueryBuildRange qbr;
QueryBuildDataSource qbds = _query.dataSourceTable(tableNum(MyTable));
int rangeCount = qbds.rangeCount();
if (rangeCount)
{
for (rangeCounter = 1; rangeCounter <= rangeCount; rangeCounter++)
{
qbr = qbds.range(rangeCounter);
if (qbr.value())
{
rangeValue = fieldId2pname(tableNum(MyTable), qbr.field()) + " : " + qbr.value();
queryRange = queryRange? (queryRange + ", " + rangeValue) : (queryRange + rangeValue);
}
}
}
queryRange = "Report filter :" + queryRange;
return queryRange;
}
Step 3 : You'll need a controller class and to override preRunModifyContract(). In this method set the parameter value to use the string from Step 2.
protected void preRunModifyContract()
{
str queryRangeCriteria;
#define.parameterReportFilterCriteria('ReportFilterCriteria')
SrsReportRdlDataContract contract = this.parmReportContract().parmRdlContract();
Query query = this.getFirstQuery();
queryRangeCriteria = this.getRanges(query);
contract.setValue(#parameterReportFilterCriteria, queryRangeCriteria);
}
Redeploy the report to make sure the newly added parameter is added correctly.
Finally, use the parameter as you wish on the report design using expression : =Parameters!ReportFilterCriteria.Value