42c2b726b6984706f5ce81b72b6552ebfe3fec68
API/CodeSamples/ReportTimeStampTimeZoneOffset.md
| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | +#ReportTimeStampTimeZoneOffset |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | +Sets an hour shift applied the timestamp when an Izenda report is exported. This allows for all times to be shifted by a specific amount, which can be varied depending on the user or set globally. To change the time zone offset used in the body of the report, use [[Time Zone Offset|http://wiki.izenda.us/edit/API/CodeSamples/TimeZoneOffset]] |
|
| 7 | + |
|
| 8 | +**Default Value:** By default no action is taken. If a ReportTimeStampTimeZoneOffset is set, then that value will be applied to the timestamp placed on a report when it is exported. |
|
| 9 | + |
|
| 10 | +##Global.asax (C#) |
|
| 11 | + |
|
| 12 | +```csharp |
|
| 13 | +public class CustomAdHocConfig : FileSystemAdHocConfig { |
|
| 14 | + public static void InitializeReporting() { |
|
| 15 | + //Check to see if we've already initialized. |
|
| 16 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 17 | + return; |
|
| 18 | + //Initialize System |
|
| 19 | + AdHocSettings.LicenseKey = "INSERT LICENSE KEY HERE"; |
|
| 20 | + AdHocSettings.SqlServerConnectionString = @"INSERT CONNECTION STRING HERE"; |
|
| 21 | + AdHocSettings.GenerateThumbnails = true; |
|
| 22 | + AdHocSettings.DashboardViewer = "Dashboards.aspx"; |
|
| 23 | + AdHocSettings.ShowSimpleModeViewer = true; |
|
| 24 | + AdHocSettings.IdentifiersRegex = "^.*[iI][Dd]$"; |
|
| 25 | + AdHocSettings.TabsCssUrl = "Resources/css/tabs.css"; |
|
| 26 | + AdHocSettings.ReportCssUrl = "Resources/css/Report.css"; |
|
| 27 | + AdHocSettings.ShowBetweenDateCalendar = true; |
|
| 28 | + AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 29 | + AdHocSettings.PrintMode = PrintMode.Html2PdfAndHtml; |
|
| 30 | + AdHocSettings.ReportTimeStampTimeZoneOffset = -3 /The relevant Setting |
|
| 31 | + |
|
| 32 | + |
|
| 33 | +``` |
|
| 34 | + |
|
| 35 | +##Global.asax (VB.net) |
|
| 36 | +```visualbasic |
|
| 37 | + |
|
| 38 | + <Serializable()> Public Class CustomAdHocConfig |
|
| 39 | + Inherits FileSystemAdHocConfig |
|
| 40 | + Public Shared Sub InitializeReporting() |
|
| 41 | + 'Check to see if we've already initialized. |
|
| 42 | + If (HttpContext.Current.Session Is Nothing OrElse (Not (HttpContext.Current.Session("ReportingInitialized") Is Nothing))) Then |
|
| 43 | + Return |
|
| 44 | + End If |
|
| 45 | + 'Initialize System |
|
| 46 | + AdHocSettings.LicenseKey = "Insert_license_key_here" |
|
| 47 | + AdHocSettings.SqlServerConnectionString = "Insert_connction_string_here" |
|
| 48 | + AdHocSettings.GenerateThumbnails = True |
|
| 49 | + AdHocSettings.DashboardViewer = "Dashboards.aspx" |
|
| 50 | + AdHocSettings.ShowSimpleModeViewer = True |
|
| 51 | + AdHocSettings.IdentifiersRegex = "^.*[iI][Dd]$" |
|
| 52 | + AdHocSettings.TabsCssUrl = "Resources/css/tabs.css" |
|
| 53 | + AdHocSettings.ReportCssUrl = "Resources/css/Report.css" |
|
| 54 | + AdHocSettings.ShowBetweenDateCalendar = True |
|
| 55 | + AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 56 | + AdHocSettings.TimeZoneOffset = -2 'The relevant setting |
|
| 57 | + |
|
| 58 | +``` |
|
| ... | ... | \ No newline at end of file |