f7c31819718070f2e971fef65be6bdd275517581
API/CodeSamples/CheckBoxListColumns.md
| ... | ... | @@ -11,13 +11,44 @@ _**Note: The number of columns will default to the number of columns specified b |
| 11 | 11 | ##Global.asax (C♯) |
| 12 | 12 | |
| 13 | 13 | ```csharp |
| 14 | - |
|
| 14 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 15 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 16 | +{ |
|
| 17 | + // Configure settings |
|
| 18 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 19 | + public static void InitializeReporting() { |
|
| 20 | + //Check to see if we've already initialized. |
|
| 21 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 22 | + return; |
|
| 23 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 24 | + //Creates a connection to Microsoft SQL Server |
|
| 25 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 26 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 27 | + AdHocSettings.CheckBoxListColumns = 2; //The relevant setting |
|
| 28 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 29 | + } |
|
| 30 | +} |
|
| 15 | 31 | ``` |
| 16 | 32 | |
| 17 | 33 | ##Global.asax (VB.NET) |
| 18 | 34 | |
| 19 | 35 | ```visualbasic |
| 20 | - |
|
| 36 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 37 | +Public Class CustomAdHocConfig |
|
| 38 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 39 | + |
|
| 40 | + Shared Sub InitializeReporting() |
|
| 41 | + 'Check to see if we've already initialized |
|
| 42 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 43 | + Return |
|
| 44 | + 'Initialize System |
|
| 45 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 46 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 47 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 48 | + AdHocSettings.CheckBoxListColumns = 2 'The relevant setting |
|
| 49 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 50 | + End Sub |
|
| 51 | +End Class |
|
| 21 | 52 | ``` |
| 22 | 53 | |
| 23 | 54 | ##Screenshots |