acf7fff134eab6e9788f22b81bc5b77826df674a
API/CodeSamples/AllowAutomaticSubreport.md
| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | +#AllowAutomaticSubreport |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +Gets or sets whether (Automatic) subreport option is available. The option appears under the advanced field options on the fields tab of the report designer page. If this is set to true, the option will appear in the dropdown as the second menu option with the default option being an ellipsis (...). If this is set to false, the option will not appear. |
|
| 6 | + |
|
| 7 | +##Global.asax (C♯) |
|
| 8 | + |
|
| 9 | +```csharp |
|
| 10 | +//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 11 | +public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 12 | +{ |
|
| 13 | + // Configure settings |
|
| 14 | + // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method |
|
| 15 | + public static void InitializeReporting() { |
|
| 16 | + //Check to see if we've already initialized. |
|
| 17 | + if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null) |
|
| 18 | + return; |
|
| 19 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"; |
|
| 20 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 21 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig(); |
|
| 22 | + AdHocSettings.AllowAutomaticSubreport= false; //The relevant setting |
|
| 23 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 24 | + } |
|
| 25 | +} |
|
| 26 | +``` |
|
| 27 | + |
|
| 28 | +##Global.asax (VB.NET) |
|
| 29 | + |
|
| 30 | +```visualbasic |
|
| 31 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 32 | +Public Class CustomAdHocConfig |
|
| 33 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 34 | + |
|
| 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.AllowAutomaticSubreport= false; 'The relevant setting |
|
| 44 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 45 | + End Sub |
|
| 46 | +End Class |
|
| 47 | +``` |
|
| ... | ... | \ No newline at end of file |