78b514c71791f308550e005f1b39a135e43e884c
API/CodeSamples/ShowReportsInHtmlOutput.md
| ... | ... | @@ -4,4 +4,51 @@ |
| 4 | 4 | |
| 5 | 5 | ##About |
| 6 | 6 | |
| 7 | -**Obsolete:** This setting has been obsolete as of version 6.0. |
|
| ... | ... | \ No newline at end of file |
| 0 | +**Obsolete:** This setting has been obsolete as of version 6.0. |
|
| 1 | + |
|
| 2 | +Gets or sets whether the dropdown list of reports in the Report Viewer is shown. |
|
| 3 | + |
|
| 4 | +##Global.asax(C♯) |
|
| 5 | + |
|
| 6 | +```csharp |
|
| 7 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 8 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 9 | +{ |
|
| 10 | + // Configure settings |
|
| 11 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 12 | + public static void InitializeReporting() { |
|
| 13 | + //Check to see if we've already initialized. |
|
| 14 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 15 | + return; |
|
| 16 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 17 | + //Creates a connection to Microsoft SQL Server |
|
| 18 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 19 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 20 | + AdHocSettings.ShowReportsInHtmlOutput = true; //the relevant setting |
|
| 21 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 22 | + } |
|
| 23 | +} |
|
| 24 | +``` |
|
| 25 | + |
|
| 26 | +##Global.asax (VB.NET) |
|
| 27 | + |
|
| 28 | +```visualbasic |
|
| 29 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 30 | +Public Class CustomAdHocConfig |
|
| 31 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 32 | + |
|
| 33 | + 'Configure settings |
|
| 34 | + 'Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 35 | + Shared Sub InitializeReporting() |
|
| 36 | + 'Check to see if we've already initialized. |
|
| 37 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 38 | + Return |
|
| 39 | + 'Initialize System |
|
| 40 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 41 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 42 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 43 | + AdHocSettings.ShowReportsInHtmlOutput = True 'The relevant setting |
|
| 44 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 45 | + End Sub |
|
| 46 | +End Class |
|
| 47 | +``` |
|
| ... | ... | \ No newline at end of file |