API/CodeSamples/SaveReportSetNextUrl.md
... ...
@@ -0,0 +1,59 @@
1
+#SaveReportSetNextUrl
2
+
3
+##About
4
+
5
+Gets or sets the URL of the page to which users will be redirected after saving the report. If defined, the user will be automatically redirected to this url after saving a report.
6
+
7
+You could use this feature if you want to modify how users save reports. Normally, a simple popup will appear on the screen that prompts the user to enter a Name and a Category and once these fields are entered, the user will be redirected back to the Report List. But if you define a url with this setting, users will be directed to your custom page where you can require additional elements such as custom scheduling controls or advanced sharing. Since Izenda saves the report before the redirect, you will have full access to the report by pulling it from your File System or Database.
8
+
9
+**Note:** The report name will be automatically added to the url query string as a parameter named "rn". Therefore, your URL could look like "www.yourdomain.com/CustomSave.aspx?rn=SavedReportName" and you will be able to grab the report from the file system or database with the query string parameter.
10
+
11
+##Global.asax (C♯)
12
+
13
+```csharp
14
+//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
15
+public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
16
+{
17
+ // Configure settings
18
+ // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
19
+ public static void InitializeReporting() {
20
+ //Check to see if we've already initialized.
21
+ if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
22
+ return;
23
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
24
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
25
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
26
+ HttpContext.Current.Session["ReportingInitialized"] = true;
27
+ }
28
+
29
+ //Add custom settings below
30
+ public override void ConfigureSettings() {
31
+ AdHocSettings.SaveReportSetNextUrl = "";
32
+ }
33
+}
34
+```
35
+
36
+##Global.asax (VB.NET)
37
+
38
+```visualbasic
39
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
40
+Public Class CustomAdHocConfig
41
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
42
+
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.SaveReportSetNextUrl = "URL-TO-REDIRECT-TO.aspx"
57
+ End Sub
58
+End Class
59
+```
... ...
\ No newline at end of file