060e3f798b29f255e4b0f8b63ff9b718f182519c
API/CodeSamples/CurrentUserName.md
| ... | ... | @@ -22,12 +22,9 @@ public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
| 22 | 22 | //Creates a connection to Microsoft SQL Server |
| 23 | 23 | AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
| 24 | 24 | AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
| 25 | + AdHocSettings.CurrentUserName = (String)HttpContext.Current.Session["UserName"]; //The relevant settign |
|
| 25 | 26 | HttpContext.Current.Session["ReportingInitialized"] = true; |
| 26 | 27 | } |
| 27 | - |
|
| 28 | - public override void PostLogin() { |
|
| 29 | - AdHocSettings.CurrentUserName = (String)HttpContext.Current.Session["UserName"]; |
|
| 30 | - } |
|
| 31 | 28 | } |
| 32 | 29 | ``` |
| 33 | 30 | |
| ... | ... | @@ -46,11 +43,8 @@ Public Class CustomAdHocConfig |
| 46 | 43 | AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
| 47 | 44 | AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
| 48 | 45 | AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
| 46 | + AdHocSettings.CurrentUserName = HttpContext.Current.Session("UserName").ToString() 'The relevant setting |
|
| 49 | 47 | HttpContext.Current.Session("ReortingInitialized") = True |
| 50 | 48 | End Sub |
| 51 | - |
|
| 52 | - Public Overrides Sub ConfigureSettings() |
|
| 53 | - AdHocSettings.CurrentUserName = HttpContext.Current.Session("UserName").ToString() |
|
| 54 | - End Sub |
|
| 55 | 49 | End Class |
| 56 | 50 | ``` |
| ... | ... | \ No newline at end of file |