API/CodeSamples/PreventCSVInjection.md
... ...
@@ -0,0 +1,58 @@
1
+#PreventCSVInjection
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+If enabled, escapes description strings which begin with the common Excel characters which denote a formula. These characters are:
8
+
9
+Equals to ("=")
10
+Plus ("+")
11
+Minus ("-")
12
+At ("@")
13
+
14
+**Default Value:**
15
+
16
+false
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 (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
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.PreventCSVInjection = true; //The relevant setting
34
+ HttpContext.Current.Session["ReportingInitialized"] = true;
35
+ }
36
+}
37
+```
38
+
39
+##Global.asax (VB.NET)
40
+
41
+```visualbasic
42
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
43
+Public Class CustomAdHocConfig
44
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
45
+
46
+ Shared Sub InitializeReporting()
47
+ 'Check to see if we've already initialized
48
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
49
+ Return
50
+ 'Initialize System
51
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
52
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
53
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
54
+ AdHocSettings.PreventCSVInjection = true 'The relevant setting
55
+ HttpContext.Current.Session("ReportingInitialized") = True
56
+ End Sub
57
+End Class
58
+```
... ...
\ No newline at end of file