02f2af4dfa2808b2dfdb8338c61a61204fbb6e04
API/CodeSamples/MapInfoCollection.md
| ... | ... | @@ -0,0 +1,59 @@ |
| 1 | +#MapInfoCollection |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Gets or sets the registered maps data for use on the Maps tab of the Izenda.Web.UI.AdHocReportDesigner. |
|
| 8 | + |
|
| 9 | +**Default Value:** MapInfoCollection[4] |
|
| 10 | + |
|
| 11 | +Keys: |
|
| 12 | + |
|
| 13 | +* World |
|
| 14 | +* Europe |
|
| 15 | +* USA |
|
| 16 | +* Australia |
|
| 17 | + |
|
| 18 | +##Global.asax (C♯) |
|
| 19 | + |
|
| 20 | +```csharp |
|
| 21 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 22 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 23 | +{ |
|
| 24 | + // Configure settings |
|
| 25 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 26 | + public static void InitializeReporting() { |
|
| 27 | + //Check to see if we've already initialized. |
|
| 28 | + if (AdHocContext.Initialized) |
|
| 29 | + return; |
|
| 30 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 31 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 32 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 33 | + AdHocSettings.MapInfoCollection.Remove("Australia"); //The relevant setting |
|
| 34 | + AdHocContext.Initialized = true; |
|
| 35 | + } |
|
| 36 | +} |
|
| 37 | +``` |
|
| 38 | + |
|
| 39 | +##Global.asax (VB.NET) |
|
| 40 | + |
|
| 41 | +```visualbasic |
|
| 42 | + |
|
| 43 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 44 | +Public Class CustomAdHocConfig |
|
| 45 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 46 | + |
|
| 47 | + Shared Sub InitializeReporting() |
|
| 48 | + 'Check to see if we've already initialized |
|
| 49 | + If AdHocContext.Initialized Then |
|
| 50 | + Return |
|
| 51 | + 'Initialize System |
|
| 52 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 53 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 54 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 55 | + AdHocSettings.MapInfoCollection.Remove("Australia") 'The relevant setting |
|
| 56 | + AdHocContext.Initialized = True |
|
| 57 | + End Sub |
|
| 58 | +End Class |
|
| 59 | +``` |
|
| ... | ... | \ No newline at end of file |