API/CodeSamples/ShowSettingsButton.md
... ...
@@ -0,0 +1,62 @@
1
+#ShowSettingsButton
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+Gets or sets the value enabling the Settings button on the Izenda Reports toolbar. The settings button launches the settings page, which allows for a GUI-oriented interface for modifying various common settings. However, we highly recommend using the ``InitializeReporting()`` method to perform your initialization.
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
+ AdHocSettings.ShowSettingsButton = true; //the relevant setting
26
+ HttpContext.Current.Session["ReportingInitialized"] = true;
27
+ }
28
+}
29
+```
30
+
31
+##Global.asax (VB.NET)
32
+
33
+```visualbasic
34
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
35
+Public Class CustomAdHocConfig
36
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
37
+
38
+ 'Configure settings
39
+ 'Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
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.ShowSettingsButton = True 'The relevant setting
49
+ HttpContext.Current.Session("ReportingInitialized") = True
50
+ End Sub
51
+End Class
52
+```
53
+
54
+##Screenshots
55
+
56
+AdHocSettings.ShowSettingsButton = false
57
+
58
+![]()
59
+
60
+AdHocSettings.ShowSettingsButton = true
61
+
62
+![]()
... ...
\ No newline at end of file