68226649d93a60f374d9e84f4ce42489387898d1
API/CodeSamples/ShowDataSourcesAsCheckBoxes.md
| ... | ... | @@ -0,0 +1,66 @@ |
| 1 | +#ShowDataSourcesAsCheckBoxes |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Gets or sets the value indicating which mode of the Data Sources list is shown. Setting this to true will show Data Sources as several columns of checkboxes that the user can click to add Data Sources to the report. Setting this to false will show Data Sources as a dropdown list that can be displayed categorically or in a flat view. |
|
| 8 | + |
|
| 9 | +##Global.asax (C♯) |
|
| 10 | + |
|
| 11 | +```csharp |
|
| 12 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 13 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 14 | +{ |
|
| 15 | + // Configure settings |
|
| 16 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 17 | + public static void InitializeReporting() { |
|
| 18 | + //Check to see if we've already initialized. |
|
| 19 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 20 | + return; |
|
| 21 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 22 | + //Creates a connection to Microsoft SQL Server |
|
| 23 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 24 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 25 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + //Add custom settings below |
|
| 29 | + public override void ConfigureSettings() { |
|
| 30 | + AdHocSettings.ShowDataSourcesAsCheckBoxes = true; |
|
| 31 | + } |
|
| 32 | +} |
|
| 33 | +``` |
|
| 34 | + |
|
| 35 | +##Global.asax (VB.NET) |
|
| 36 | + |
|
| 37 | +```visualbasic |
|
| 38 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 39 | +Public Class CustomAdHocConfig |
|
| 40 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 41 | + |
|
| 42 | + 'Configure settings |
|
| 43 | + 'Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 44 | + Shared Sub InitializeReporting() |
|
| 45 | + 'Check to see if we've already initialized. |
|
| 46 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 47 | + Return |
|
| 48 | + 'Initialize System |
|
| 49 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 50 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 51 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 52 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 53 | + End Sub |
|
| 54 | + |
|
| 55 | + 'Add custom settings below |
|
| 56 | + Public Overrides Sub ConfigureSettings() |
|
| 57 | + AdHocSettings.ShowDataSourcesAsCheckBoxes = True |
|
| 58 | + End Sub |
|
| 59 | +End Class |
|
| 60 | +``` |
|
| 61 | + |
|
| 62 | +##Screenshots |
|
| 63 | + |
|
| 64 | +###ShowDataSourcesAsCheckBoxes = true |
|
| 65 | + |
|
| 66 | +###ShowDataSourcesAsCheckBoxes = false |
|
| ... | ... | \ No newline at end of file |