c9c0916d8156db3affbf2d4f1f5d815e272edf0e
FAQ/FilteredListReports.md
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +#FilteredListReports() |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +This method 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 ReportInfo[] FilteredListReports() { |
|
| 13 | + ReportInfo[] reports = ListReports(); |
|
| 14 | + ArrayList result = new ArrayList(); |
|
| 15 | + foreach (ReportInfo info in reports) { |
|
| 16 | + if (info.Category == "Hidden reports") |
|
| 17 | + continue; |
|
| 18 | + ReportSet reportSet = LoadFilteredReportSet(info.Name); |
|
| 19 | + if (reportSet != null && reportSet.CanBeLoaded) |
|
| 20 | + result.Add(info); |
|
| 21 | + } |
|
| 22 | + return (ReportInfo[])result.ToArray(typeof(ReportInfo)); |
|
| 23 | + } |
|
| 24 | +``` |
|
| 25 | + |
|
| 26 | +##Global.asax (VB.NET) |
|
| 27 | + |
|
| 28 | +```visualbasic |
|
| 29 | +Public Overrides Function FilteredListReports() As ReportInfo() |
|
| 30 | + Dim reports() As ReportInfo = ListReports() |
|
| 31 | + Dim result As New ArrayList() |
|
| 32 | + For Each info As ReportInfo in reports |
|
| 33 | + If info.Category = "Hidden reports" Then Continue For |
|
| 34 | + Dim reportSet As ReportSet = LoadFilteredReportSet(info.Name) |
|
| 35 | + If reportSet IsNot Nothing AndAlso reportSet.CanBeLoaded Then result.Add(info) |
|
| 36 | + Next |
|
| 37 | + Return DirectCast(result.ToArray(GetType(ReportInfo)), ReportInfo()) |
|
| 38 | +End Function |
|
| 39 | +``` |
|
| ... | ... | \ No newline at end of file |