API/CodeSamples/AutoOrForRepeatFilters.md
... ...
@@ -18,13 +18,13 @@ public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
18 18
// Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
19 19
public static void InitializeReporting() {
20 20
//Check to see if we've already initialized.
21
- if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
21
+ if (AdHocContext.Initialized)
22 22
return;
23 23
AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
24 24
AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
25 25
Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
26 26
AdHocSettings.AutoOrForRepeatFilters = true; //The relevant setting
27
- HttpContext.Current.Session["ReportingInitialized"] = true;
27
+ AdHocContext.Initialized = true;
28 28
}
29 29
}
30 30
```
... ...
@@ -38,14 +38,14 @@ Public Class CustomAdHocConfig
38 38
39 39
Shared Sub InitializeReporting()
40 40
'Check to see if we've already initialized
41
- If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
41
+ If AdHocContext.Initialized Then
42 42
Return
43 43
'Initialize System
44 44
AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
45 45
AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
46 46
Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
47 47
AdHocSettings.AutoOrForRepeatFilters = true 'The relevant setting
48
- HttpContext.Current.Session("ReportingInitialized") = True
48
+ AdHocContext.Initialized = True
49 49
End Sub
50 50
End Class
51 51
```
... ...
\ No newline at end of file