f4a219b72e28e2f74441d4be5d6bbdaa8221be07
API/CodeSamples/DefaultPreviewResults.md
| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | +#DefaultPreviewResults |
|
| 2 | + |
|
| 3 | +[[_TOC_]] |
|
| 4 | + |
|
| 5 | +##About |
|
| 6 | + |
|
| 7 | +This changes the default number of results (records) shown in the report designer preview tab. Izenda does not recommend setting this to a large number such as 5000 or larger as the html report will take a long time to generate. When exporting, all results will always be exported. Web browsers can become slow or stop completely when reports with hundreds of thousands of lines are generated, so keep this in mind when changing this setting. Ideally, this should be set to a power of 10 (1, 10, 100, 1000, etc). |
|
| 8 | + |
|
| 9 | +##Global.asax (C♯) |
|
| 10 | + |
|
| 11 | +```csharp |
|
| 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 | + AdHocSettings.DefaultPreviewResults = 500; |
|
| 25 | + HttpContext.Current.Session["ReportingInitialized"] = true; |
|
| 26 | + } |
|
| 27 | +} |
|
| 28 | +``` |
|
| 29 | + |
|
| 30 | +##Global.asax (VB.NET) |
|
| 31 | + |
|
| 32 | +```visualbasic |
|
| 33 | +'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig |
|
| 34 | +Public Class CustomAdHocConfig |
|
| 35 | + Inherits Izenda.AdHoc.DatabaseAdHocConfig |
|
| 36 | + |
|
| 37 | + Shared Sub InitializeReporting() |
|
| 38 | + 'Check to see if we've already initialized |
|
| 39 | + If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then |
|
| 40 | + Return |
|
| 41 | + 'Initialize System |
|
| 42 | + AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE" |
|
| 43 | + AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE" |
|
| 44 | + Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig() |
|
| 45 | + AdHocSettings.DefaultPreviewResults= 500 |
|
| 46 | + HttpContext.Current.Session("ReportingInitialized") = True |
|
| 47 | + End Sub |
|
| 48 | +End Class |
|
| 49 | +``` |
|
| ... | ... | \ No newline at end of file |