3ba1398bfcb0c38a91b85dceb738717e1c07b9c4
API/CodeSamples/AddAllFilterRegex.md
| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | +#AddAllFilterRegex |
|
| 2 | + |
|
| 3 | +This setting allows the user to use a regular expression to filter certain fields from being added through the "Add All" button (the "Add All" button can be turned on in the features tab of the settings guide and is added in the fields section of report designer). An example of when this may be used is if you don't want social security numbers added to reports you could add part of the name of that field to the regular expression. |
|
| 4 | + |
|
| 5 | +##Global.asax (C) |
|
| 6 | +```csharp |
|
| 7 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 8 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 9 | +{ |
|
| 10 | + // Configure settings |
|
| 11 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 12 | + public static void InitializeReporting() { |
|
| 13 | + //Check to see if we've already initialized. |
|
| 14 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 15 | + return; |
|
| 16 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 17 | + //Creates a connection to Microsoft SQL Server |
|
| 18 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 19 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 20 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 21 | + } |
|
| 22 | + public override void ConfigureSettings() { |
|
| 23 | + AdHocSettings.AddAllFilterRegex = "(id|guid)$"; |
|
| 24 | + } |
|
| 25 | +} |
|
| 26 | + |
|
| 27 | +##Global.asax (VB.NET) |
|
| 28 | + |
|
| 29 | +```visualbasic |
|
| 30 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 31 | +Public Class CustomAdHocConfig |
|
| 32 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 33 | + |
|
| 34 | + Shared Sub InitializeReporting() |
|
| 35 | + 'Check to see if we've already initialized |
|
| 36 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 37 | + Return |
|
| 38 | + 'Initialize System |
|
| 39 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 40 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 41 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 42 | + HttpContext.Current.Session("ReortingInitialized") = True |
|
| 43 | + End Sub |
|
| 44 | + |
|
| 45 | + Public Overrides Sub ConfigureSettings() |
|
| 46 | + AdHocSettings.AddAllFilterRegex = "(id|guid)$" |
|
| 47 | + End Sub |
|
| 48 | +End Class |
|
| 49 | +``` |
|
| ... | ... | \ No newline at end of file |