df3f979de70203e637980c3c2ee093b24e4dd893
API/CodeSamples/SavedReportsTable.md
| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | +#LicenseKey |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Gets or sets the table name for saved reports. If DatabaseAdHocConfig is used, reports data will be saved in this table in the database. This setting does nothing if FileSystemAdHocConfig is used. By default, a table named "IzendaAdHocReports" is used. |
|
| 8 | + |
|
| 9 | +##Global.asax (C♯) |
|
| 10 | +```c# |
|
| 11 | + |
|
| 12 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 13 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 14 | +{ |
|
| 15 | + // Configure settings |
|
| 16 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 17 | + public static void InitializeReporting() { |
|
| 18 | + //Check to see if we've already initialized. |
|
| 19 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 20 | + return; |
|
| 21 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 22 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 23 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 24 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + //Add custom settings below |
|
| 28 | + public override void ConfigureSettings() { |
|
| 29 | + AdHocSettings.SavedReportsTable = "YourReportingTable"; |
|
| 30 | + } |
|
| 31 | +} |
|
| 32 | +``` |
|
| 33 | + |
|
| 34 | +##Global.asax (VB.NET) |
|
| 35 | + |
|
| 36 | +```visualbasic |
|
| 37 | + |
|
| 38 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 39 | +Public Class CustomAdHocConfig |
|
| 40 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 41 | + |
|
| 42 | + Shared Sub InitializeReporting() |
|
| 43 | + 'Check to see if we've already initialized |
|
| 44 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 45 | + Return |
|
| 46 | + 'Initialize System |
|
| 47 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 48 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 49 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 50 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 51 | + End Sub |
|
| 52 | + |
|
| 53 | + 'Add custom settings below |
|
| 54 | + Public Overrides Sub ConfigureSettings() |
|
| 55 | + AdHocSettings.SavedReportsTable = "YourReportingTable" |
|
| 56 | + End Sub |
|
| 57 | +End Class |
|
| 58 | +``` |
|
| ... | ... | \ No newline at end of file |