Hi,
I have a report that shows eg. Company and department names, I have built a filter by both of these to say
Company in Company parameter
and
Department in Department parameter
Where the Company and Department parameters are multi-value and are built from a datasource. Everything works just fine...as long as at least one company and department value are selected in the filter boxes ie. it is always filtering on these fields.
How do I get the report to display everything when nothing is selected in the filter boxes?
5 Answers, 1 is accepted
Set the default value for both parameters so if no value is set by the user the filters will be applied based on the parameters default values.
To set multiple values(all values) as the default ones, set the parameters Value property to an IEnumerable instance - check Specifying Default Values for a MultiValue Parameter for more detailed information.
Regards,
Katia
Telerik by Progress

Thanks Katia,
I use the html viewer with a custom resolver to load trdp reports dynamically - how would I use that code in that scenario?
I mean I know how to set parameters default values but how would I get the argument "Fields.MyField" to pass to AllValues(object[] values).
In case, you need to set report parameters in custom resolver you can work directly with the report instance's ReportParameters collection, for example:
Telerik.Reporting.Report report =
new
Report1();
report.ReportParameters[
"Parameter1"
].Value =
"= AllValues(Fields.MyField)"
;
Note, that TRDP report needs to be unpackaged first - Unpackaging.
Regards,
Katia
Telerik by Progress

Thanks Katia,
I'll give that a bash but am pretty sure it will not work as per my post here:

Just some feedback - I have no clue what's going on here but here is my code that does indeed seem to set the default value for multi-value parameters to all available options in a custom resolver:
Thanks Katia.
ReportConnectionStringManager csm =
new
ReportConnectionStringManager(providerConnStr);
var appPath = HttpContext.Current.Server.MapPath(
"~/"
);
var reportsPath = Path.Combine(appPath,
"Reports"
);
var uri = Path.Combine(reportsPath, report);
var sourceReportSource =
new
UriReportSource() { Uri = uri };
reportInstance = csm.UpdateReportSource(sourceReportSource);
//Set parameters
foreach
(var reportParm
in
(reportInstance
as
InstanceReportSource).ReportDocument.ReportParameters)
{
if
(reportParm.Name.ToLower() ==
"Department"
.ToLower())
{
reportParm.Value =
"= AllValues(Fields.Department)"
;
}
}