FAQ/applying-hidden-filters-programmatically.md
... ...
@@ -54,7 +54,7 @@ public bool FilterCanBeAddedToReport(JoinedTableCollection jts, out Filter newFi
54 54
```visualbasic
55 55
Public Overrides Sub PreExecuteReportSet(ByVal reportSet As ReportSet)
56 56
If reportSet.IsDashBoard Then
57
- Dim myReport As Report = reportSet.Reports(0)
57
+ Dim myReport As Report = reportSet.Reports(0) 'This report will always represent the dashboard tile currently being handled by the system.
58 58
Dim newFilter As Filter = Nothing
59 59
If FilterCanBeAddedToReport(myReport.JoinedTables, newFilter) Then
60 60
myReport.Filters.Add(newFilter)
... ...
@@ -72,7 +72,7 @@ Public Function FilterCanBeAddedToReport(jts As JoinedTableCollection, ByRef new
72 72
newFilter = Nothing
73 73
For Each jt As JoinedTable In jts
74 74
For Each col As Column In AdHocContext.Driver.DatabaseSchema.Tables(jt.DbTable.FullName).Columns.AllValues
75
- If col.FullName.ToLower().Contains("Customer_ID".ToLower()) Then
75
+ If col.FullName.ToLower().Contains("CustomerID".ToLower()) Then 'replace "Customer_ID" with the column name to check for. If there is other criteria that must be met, then add that information into this if statement
76 76
newFilter = New Filter(col.FullName)
77 77
newFilter.Hidden = True
78 78
newFilter.Value = "BONAP"