FAQ/Questions/Applying-Security-to-Scheduled-Reports.md
... ...
@@ -6,10 +6,10 @@
6 6
7 7
This code sample shows how to apply security for the owner of the report when it gets sent out via the scheduler. This can allow reports to get disseminated based on the report owner's tenant ID and prevent any users outside of that group from receiving the report.
8 8
9
-##C♯
9
+##C♯ Example
10 10
11 11
```csharp
12
-public override void PreExecuteReportSet(Izenda.AdHoc.ReportSetreportSet)
12
+public override void PreExecuteReportSet(Izenda.AdHoc.ReportSet reportSet)
13 13
{
14 14
bool scheduler = AdHocSettings.CurrentUserName.Equals("DefaultAdministrator");
15 15
if (scheduler)
... ...
@@ -19,4 +19,22 @@ public override void PreExecuteReportSet(Izenda.AdHoc.ReportSetreportSet)
19 19
reportSet.Filters.AddHidden(f);
20 20
}
21 21
} //end method
22
-```
... ...
\ No newline at end of file
0
+```
1
+
2
+##VB.NET Example
3
+
4
+```visualbasic
5
+Public Overrides Sub PreExecuteReportSet(ByVal reportSet As Izenda.AdHoc.ReportSet)
6
+ Dim scheduler As Boolean = AdHocSettings.CurrentUserName.Equals("DefaultAdministrator")
7
+ If scheduler Then
8
+ Dim f As Filter = New Filter("TenantID")
9
+ f.Value = LookupTenantIDFromUser(reportSet.UserName) 'Write your own implementation of this method
10
+ reportSet.Filters.AddHidden(f)
11
+ End If
12
+End Sub 'end method
13
+```
14
+
15
+
16
+##Limitations
17
+
18
+The Email Scheduler in the reporting system does not have a way to provide authentication (login & password) to your SMTP server. For the email scheduler to send messages to an SMTP server, you would need to provide an open path via the web server's IP address to the SMTP server that would not require authentication.
... ...
\ No newline at end of file