API/CodeSamples/AllowDataFieldsInDescription.md
... ...
@@ -0,0 +1,59 @@
1
+#AllowDataFieldsInDescription
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+Gets or sets whether to allow a data field to be used in the description field of the report on the Misc tab of the Report Designer. This is particularly useful in drill-down reports and reports with filters. For example, let's say we are filtering a report by the field "CategoryName" with the value "Produce". When we enter [CategoryName] in the description field, the report will display Produce above the data grid instead of [CategoryName]. This will dynamically change when the user changes the filter value.
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
+ HttpContext.Current.Session["ReportingInitialized"] = true;
25
+ }
26
+
27
+ //Add custom settings below
28
+ public override void ConfigureSettings() {
29
+ AdHocSettings.AllowDataFieldsInDescription = true;
30
+ }
31
+}
32
+```
33
+
34
+##Global.asax (VB.NET)
35
+
36
+```visualbasic
37
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
38
+Public Class CustomAdHocConfig
39
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
40
+
41
+ 'Configure settings
42
+ 'Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
43
+ Shared Sub InitializeReporting()
44
+ 'Check to see if we've already initialized.
45
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
46
+ Return
47
+ 'Initialize System
48
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
49
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
50
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
51
+ HttpContext.Current.Session("ReportingInitialized") = True
52
+ End Sub
53
+
54
+ 'Add custom settings below
55
+ Public Overrides Sub ConfigureSettings()
56
+ AdHocSettings.AllowDataFieldsInDescription = True
57
+ End Sub
58
+End Class
59
+```
... ...
\ No newline at end of file