4b65daafe4a0522aa61e9b02d04a73a26ec9e0e9
FAQ/FilteredListReportsDictionary.md
| ... | ... | @@ -0,0 +1,43 @@ |
| 1 | +#FilteredListReportsDictionary |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +This method is used on the report list page and returns a list of reports that are guaranteed to be available to the current user, taking into account all [[hidden filters|http://wiki.izenda.us/FAQ/applying-hidden-filter-using-inner-query]] and settings. This method can be overridden in your [[CustomAdHocConfig|http://wiki.izenda.us/Integration/Tutorials/Customizing-Izenda-Settings]] class as needed. Here is a sample of what an overridden implementation could look like. |
|
| 8 | + |
|
| 9 | +##Global.asax (C♯) |
|
| 10 | + |
|
| 11 | +```csharp |
|
| 12 | +public override Dictionary<ReportInfo, ReportSet> FilteredListReportsDictionary() |
|
| 13 | +{ |
|
| 14 | + Dictionary<ReportInfo, ReportSet> reports = base.FilteredListReportsDictionary(); |
|
| 15 | + Dictionary<ReportInfo, ReportSet> result = new Dictionary<ReportInfo, ReportSet>(); |
|
| 16 | + foreach (ReportInfo info in reports.Keys) |
|
| 17 | + { |
|
| 18 | + if (info.Category == "Hidden reports") |
|
| 19 | + continue; |
|
| 20 | + if (reports[info] != null && reports[info].CanBeLoaded) |
|
| 21 | + result.Add(info, reports[info]); |
|
| 22 | + } |
|
| 23 | + return result; |
|
| 24 | +} |
|
| 25 | +``` |
|
| 26 | + |
|
| 27 | +##Global.asax (VB.NET) |
|
| 28 | + |
|
| 29 | +```visualbasic |
|
| 30 | +Public Overrides Function FilteredListReportsDictionary() As Dictionary(Of ReportInfo, ReportSet) |
|
| 31 | + Dim reports As Dictionary(Of ReportInfo, ReportSet) = MyBase.FilteredListReportsDictionary() |
|
| 32 | + Dim result As New Dictionary(Of ReportInfo, ReportSet) |
|
| 33 | + For Each info As ReportInfo In reports.Keys |
|
| 34 | + If info.Category = "Hidden reports" Then Continue For |
|
| 35 | + If reports(info) IsNot Nothing AndAlso reports(info).CanBeLoaded Then result.Add(info, reports(info)) |
|
| 36 | + Next |
|
| 37 | + Return result |
|
| 38 | +End Function |
|
| 39 | +``` |
|
| 40 | + |
|
| 41 | +##See Also |
|
| 42 | + |
|
| 43 | +* [[FilteredListReports|FAQ/FilteredListReports]] |
|
| ... | ... | \ No newline at end of file |