FAQ/applying-hidden-filter-using-inner-query.md
... ...
@@ -13,19 +13,35 @@ Here is our sample report in the report designer:
13 13
14 14
Below is a code sample showing how to add a hidden filter to a report. We will be using this query with our sample datasource.
15 15
16
+###C♯
17
+
16 18
```csharp
17 19
public override void PreExecuteReportSet(ReportSet reportSet)
18 20
{
19
- base.PreExecuteReportSet(reportSet);
20
- Filter filter = new Filter();
21
- //These three parameters are what are normally shown in the Filters tab of the report designer
22
- filter.Column = "ShipCity"; //Filter Field
23
- filter.Operator = OperatorTypes.In; //Operator
24
- filter.Values = new string[] {"Boise"}; //Value(s)
25
- reportSet.Filters.AddHidden(filter);
21
+ base.PreExecuteReportSet(reportSet);
22
+ Filter filter = new Filter();
23
+ //These three parameters are what are normally shown in the Filters tab of the report designer
24
+ filter.Column = "ShipCity"; //Filter Field
25
+ filter.Operator = OperatorTypes.In; //Operator
26
+ filter.Values = new string[] {"Boise"}; //Value(s)
27
+ reportSet.Filters.AddHidden(filter);
26 28
}
27 29
```
28 30
31
+###VB.NET
32
+
33
+```visualbasic
34
+Public Overrides Sub PreExecuteReportSet(ByVal reportSet As Izenda.AdHoc.ReportSet)
35
+ MyBasease.PreExecuteReportSet(reportSet);
36
+ Dim filter As New Filter();
37
+ 'These three parameters are what are normally shown in the Filters tab of the report designer
38
+ filter.Column = "ShipCity" 'Filter Field
39
+ filter.Operator = OperatorTypes.In 'Operator
40
+ filter.Values = New String() {"Boise"} 'Value(s)
41
+ reportSet.Filters.AddHidden(filter)
42
+End Sub
43
+```
44
+
29 45
**Note:** The **Values** property should always be used, even for one item.
30 46
31 47
After booting up our application and running our report, here is what we get: