It's great that you've managed to solve this very interesting task.
We would like to share with you two more approaches that we consider very interesting. Both of them rely on the new functionality that Telerik Reporting Q2 2007 introduces - filters, report parameters and user defined functions.
Lets assume that we've defined one report parameter named UserSelection
(referenced later as Parameters.UserSelection
) that holds the chosen filter (No Filter, True, False) and the field that we'll filter by is named TrueFalse
(referenced later as Fields.TrueFalse
The 1st approach uses only one filter defined for the report:new Filter("=IIF(Parameters.UserSelection = "No Filter", True, Parameters.UserSelection)", FilterOperator.Equal, "=IIF(Parameters.UserSelection = "No Filter", True, Fields.TrueFalse)");
The 2nd approach instruments one user defined function:public static bool IsRowSelected(string userSelection, bool field)
case "No Filter":
return (field == true);
return (field == false);
and then uses it in the next report filter:new Filter("=IsRowSelected(Parameters.UserSelection, Fields.TrueFalse)", FilterOperator.Equal, "=True");
We personally prefer the 2nd option as using custom functions is much more descriptive, easy to read and maintain, and the report filter is simpler.
The above examples illustrate the flexibility of the new reporting engine and the endless capabilities that it offers.
I hope this helps.
the Telerik team