API/CodeSamples/LicenseKey.md
... ...
@@ -0,0 +1,86 @@
1
+#LicenseKey
2
+
3
+[[_TOC_]]
4
+
5
+This setting is required to run Izenda and must be entered as one of the very first settings in the initialization code for Izenda to run properly.
6
+
7
+##Global.asax (C♯)
8
+```csharp
9
+<%@ Application Language="C#" %>
10
+<%@ Import Namespace="Izenda.AdHoc" %>
11
+
12
+<script runat="server">
13
+
14
+ void Session_Start(object sender, EventArgs e)
15
+ {
16
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
17
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
18
+ }
19
+
20
+ public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
21
+ {
22
+ // Configure settings
23
+ // Add Custom Setting below license key and connection string setting
24
+ public override void ConfigureSettings()
25
+ {
26
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
27
+ //AdHocSettings.VisibleTables = new string[] { "VIEW1", "TABLE2" };
28
+ AdHocSettings.LicenseKey = "INSERT LICENSE KEY HERE";
29
+
30
+ }
31
+
32
+ // Control what reports are visible for the current user
33
+ public override Izenda.AdHoc.ReportInfo[] ListReports()
34
+ {
35
+ return base.ListReports();
36
+ }
37
+
38
+ // Customize a report on the fly prior to execution on a per user basis
39
+ public override void PreExecuteReportSet(Izenda.AdHoc.ReportSet reportSet)
40
+ {
41
+
42
+ }
43
+
44
+ }
45
+</script>
46
+```
47
+
48
+##Global.asax (VB.NET)
49
+
50
+```visualbasic
51
+<%@ Application Language="VB" %>
52
+<%@ Import Namespace="Izenda.AdHoc" %>
53
+
54
+<script runat="server">
55
+
56
+ Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
57
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
58
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
59
+ End Sub
60
+
61
+ Public Class CustomAdHocConfig
62
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
63
+
64
+ ' Configure settings
65
+ ' Add Custom Setting below license key and connection string setting
66
+ Public Overrides Sub ConfigureSettings()
67
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
68
+ 'AdHocSettings.VisibleTables = New String() { "VIEW1", "TABLE2" }
69
+ AdHocSettings.LicenseKey = "INSERT LICENSE KEY HERE"
70
+
71
+ End Sub
72
+
73
+ ' Control what reports are visible for the current user
74
+ Public Overrides Function ListReports() As Izenda.AdHoc.ReportInfo()
75
+ Return MyBase.ListReports
76
+ End Function
77
+
78
+ ' Customize a report on the fly prior to execution on a per user basis
79
+ Public Overrides Sub PreExecuteReportSet(ByVal reportSet As Izenda.AdHoc.ReportSet)
80
+
81
+ End Sub
82
+
83
+ End Class
84
+
85
+</script>
86
+```
... ...
\ No newline at end of file