acd5afd88eda5412cd31d06338a16e7354b2fc42
API/CodeSample/SavedReportsTable.md
| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | +#SavedReportsTable |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +Gets or sets the name of the database table that will be used to store reports when running in [[DatabaseAdHocConfig|http://wiki.izenda.us/FAQ/Storing-Reports#Database-Mode]] mode. The table will be created on the database specified with the [[connection string|http://wiki.izenda.us/Integration/Tutorials/connect-to-the-database]] unless a [[SavedReportsDriver|http://wiki.izenda.us/Guides/Izenda-AdHoc-Driver#c)-Saving-Reports-with-Fusion]] is also specified. In that case, the table will be created using the connection specified by that driver. The [[SavedReportsDriver|http://wiki.izenda.us/Guides/Izenda-AdHoc-Driver#c)-Saving-Reports-with-Fusion]] requires [[Fusion|http://wiki.izenda.us/Guides/Izenda-AdHoc-Driver#Izenda-Fusion-Driver]] to be able to use. The table will be created with the following structure: |
|
| 8 | + |
|
| 9 | +Name: [[SavedReportsTable|/API/CodeSamples/SavedReportsTable]] |
|
| 10 | + |
|
| 11 | +Columns: |
|
| 12 | +* Name: The report's name. |
|
| 13 | +* Xml: The report's XML definition. |
|
| 14 | +* CreatedDate: The date the report was first created. |
|
| 15 | +* ModifiedDate: The date the report was last modified/updated. |
|
| 16 | +* TenantID: The report's tenant ID (this is dependent on the user who created the report. See [[CurrentUserTenantID|/API/CodeSamples/CurrentUserTenantID]] for more info.) |
|
| 17 | +* IzendaAdHocReportsID: not used internally. |
|
| 18 | +* ReportSourceID: not used internally. |
|
| 19 | +* Thumbnail: The serialized image data for the thumbnail saved for this report. This can be avoided when [[GenerateThumbnails|/API/CodeSamples/GenerateThumbnails]] is set to false. |
|
| 20 | +* Form: Contains the HTML definition of any form that is associated with the report. |
|
| 21 | + |
|
| 22 | +##Global.asax (C♯) |
|
| 23 | + |
|
| 24 | +```csharp |
|
| 25 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 26 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 27 | +{ |
|
| 28 | + // Configure settings |
|
| 29 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 30 | + public static void InitializeReporting() { |
|
| 31 | + //Check to see if we've already initialized. |
|
| 32 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 33 | + return; |
|
| 34 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 35 | + //Creates a connection to Microsoft SQL Server |
|
| 36 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 37 | + AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 38 | + AdHocSettings.CurrentUserName = "MyReportsTable"; //The relevant setting |
|
| 39 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 40 | + } |
|
| 41 | +} |
|
| 42 | +``` |
|
| 43 | + |
|
| 44 | +##Global.asax (VB.NET) |
|
| 45 | + |
|
| 46 | +```visualbasic |
|
| 47 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 48 | +Public Class CustomAdHocConfig |
|
| 49 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 50 | + |
|
| 51 | + Shared Sub InitializeReporting() |
|
| 52 | + 'Check to see if we've already initialized |
|
| 53 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 54 | + Return |
|
| 55 | + 'Initialize System |
|
| 56 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 57 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 58 | + AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 59 | + AdHocSettings.SavedReportsTable = "MyReportsTable" 'The relevant setting |
|
| 60 | + HttpContext.Current.Session("ReortingInitialized") = True |
|
| 61 | + End Sub |
|
| 62 | +End Class |
|
| 63 | +``` |
|
| ... | ... | \ No newline at end of file |