d34ebfc130b2dd0992d0782ccf31bf4219b68a8d
API/CodeSamples/IdentifiersRegex.md
| ... | ... | @@ -0,0 +1,54 @@ |
| 1 | +#IdentifiersRegex |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Gets or sets the pattern that will be used to apply a default aggregate COUNT function to any fields whose descriptions match the expression. |
|
| 8 | + |
|
| 9 | +_**Note:** This setting only affects the Fields tab on the report viewer and will not affect the default selection on the report designer or the instant reports page._ |
|
| 10 | + |
|
| 11 | +**Default Value:** |
|
| 12 | + |
|
| 13 | +##Global.asax (C♯) |
|
| 14 | + |
|
| 15 | +```csharp |
|
| 16 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 17 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 18 | +{ |
|
| 19 | + // Configure settings |
|
| 20 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 21 | + public static void InitializeReporting() { |
|
| 22 | + //Check to see if we've already initialized. |
|
| 23 | + if (AdHocContext.Initialized) |
|
| 24 | + return; |
|
| 25 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 26 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 27 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 28 | + AdHocSettings.IdentifiersRegex = "(?i)((area)|(zip)|(postal))[\\W_-]*code"; //The relevant setting |
|
| 29 | + AdHocContext.Initialized = true; |
|
| 30 | + } |
|
| 31 | +} |
|
| 32 | +``` |
|
| 33 | + |
|
| 34 | +##Global.asax (VB.NET) |
|
| 35 | + |
|
| 36 | +```visualbasic |
|
| 37 | + |
|
| 38 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 39 | +Public Class CustomAdHocConfig |
|
| 40 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 41 | + |
|
| 42 | + Shared Sub InitializeReporting() |
|
| 43 | + 'Check to see if we've already initialized |
|
| 44 | + If AdHocContext.Initialized Then |
|
| 45 | + Return |
|
| 46 | + 'Initialize System |
|
| 47 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 48 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 49 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 50 | + AdHocSettings.IdentifiersRegex = "(?i)((area)|(zip)|(postal))[\\W_-]*code" 'The relevant setting |
|
| 51 | + AdHocContext.Initialized = True |
|
| 52 | + End Sub |
|
| 53 | +End Class |
|
| 54 | +``` |
|
| ... | ... | \ No newline at end of file |