API/CodeSamples/PrintMode.md
... ...
@@ -0,0 +1,72 @@
1
+#PrintMode
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+Gets or sets the value indicating what print mode will be used for printing reports on the ReportDesigner. There are a number of different settings for this property consisting of different combinations of HTML and PDF formats. This setting also controls the legacy ReportViewer toolbar. It currently has no effect on the modern ReportViewer.
8
+
9
+_**Default Value:** PrintMode.PdfAndHtml (PrintMode.Html2PdfAndHtml for version 6.6 and higher)_
10
+
11
+Possible values:
12
+* PdfAndHtml
13
+* Html2PdfAndHtml
14
+* Html
15
+* Pdf
16
+* Html2Pdf
17
+
18
+##Global.asax (C♯)
19
+
20
+``` csharp
21
+//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
22
+public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
23
+{
24
+ // Configure settings
25
+ // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
26
+ public static void InitializeReporting() {
27
+ //Check to see if we've already initialized.
28
+ if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
29
+ return;
30
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
31
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
32
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
33
+ AdHocSettings.PrintMode = PrintMode.Html2PdfAndHtml; //The relevant setting
34
+ HttpContext.Current.Session["ReportingInitialized"] = true;
35
+ }
36
+}
37
+```
38
+
39
+##Global.asax (VB.NET)
40
+
41
+```visualbasic
42
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
43
+Public Class CustomAdHocConfig
44
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
45
+
46
+ Shared Sub InitializeReporting()
47
+ 'Check to see if we've already initialized
48
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
49
+ Return
50
+ 'Initialize System
51
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
52
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
53
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
54
+ AdHocSettings.PrintMode = PrintMode.Html2PdfAndHtml 'The relevant setting
55
+ HttpContext.Current.Session("ReportingInitialized") = True
56
+ End Sub
57
+End Class
58
+```
59
+
60
+##Screenshots
61
+
62
+PrintMode.Html2PdfAndHtml
63
+
64
+![](/API/CodeSamples/PrintMode/PrintMode_Html2PdfAndHtml.png)
65
+
66
+PrintMode.Html2Pdf
67
+
68
+![](/API/CodeSamples/PrintMode/PrintMode_Html2Pdf.png)
69
+
70
+PrintMode.Html
71
+
72
+![](/API/CodeSamples/PrintMode/PrintMode_Html.png)
... ...
\ No newline at end of file