API/CodeSamples/DefaultSharingRights.md
... ...
@@ -0,0 +1,59 @@
1
+#DefaultSharingRights
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+Gets or sets the Default Sharing Rights. Defines sharing rights that are assigned to the report by default. The possible values for this are:
8
+
9
+* "Full Access"
10
+* "Read Only"
11
+* "View Only"
12
+* "Locked"
13
+* "None"
14
+
15
+Setting this will change what is displayed in the "Rights" dropdown menu on the [[Misc tab|http://wiki.izenda.us/Guides/ReportDesign/9.0-Misc-Tab#9.1-Share-With-&-Rights]] of the report designer to the value specified. This can save your users the trouble of having to switch from the default value.
16
+
17
+**Default value**: None
18
+
19
+##Global.asax (C♯)
20
+
21
+```csharp
22
+//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
23
+public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
24
+{
25
+ // Configure settings
26
+ // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
27
+ public static void InitializeReporting() {
28
+ //Check to see if we've already initialized.
29
+ if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
30
+ return;
31
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
32
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
33
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
34
+ AdHocSettings.DefaultPreviewResults = 500;
35
+ HttpContext.Current.Session["ReportingInitialized"] = true;
36
+ }
37
+}
38
+```
39
+
40
+##Global.asax (VB.NET)
41
+
42
+```visualbasic
43
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
44
+Public Class CustomAdHocConfig
45
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
46
+
47
+ Shared Sub InitializeReporting()
48
+ 'Check to see if we've already initialized
49
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
50
+ Return
51
+ 'Initialize System
52
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
53
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
54
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
55
+ AdHocSettings.DefaultPreviewResults= 500
56
+ HttpContext.Current.Session("ReportingInitialized") = True
57
+ End Sub
58
+End Class
59
+```
... ...
\ No newline at end of file