3b41ae2e9d1ba8c88d0cddba3d7662d9ce61a5ef
FAQ/Questions/How-do-I-use-ExtendedFormats-for-European-Date-Formats.md
| ... | ... | @@ -1,21 +1,20 @@ |
| 1 | -#How do I Use Custom Date Formats? |
|
| 1 | +#Applying Security for Owner of the Report Out of Scheduler |
|
| 2 | 2 | |
| 3 | 3 | [[_TOC_]] |
| 4 | 4 | |
| 5 | -In this example, we show how to set the formats when using an International Date format. This example is for the European Date format and needs to be placed in the ``InitializeReporting()`` method of your global.asax file. |
|
| 5 | +##About |
|
| 6 | 6 | |
| 7 | -```csharp |
|
| 8 | -public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig |
|
| 9 | -{ |
|
| 10 | - // Configure settings |
|
| 11 | - |
|
| 12 | - // Add Custom Setting below license key and connection string setting |
|
| 13 | - public override void ConfigureSettings() |
|
| 14 | - { |
|
| 15 | - AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"; |
|
| 16 | - AdHocSettings.Formats.Add("EuroDate", "{0:dd/MM/yyyy}"); |
|
| 17 | - } |
|
| 18 | -} |
|
| 19 | -``` |
|
| 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. |
|
| 20 | 8 | |
| 21 | -You can use this example as a template for other date formats as well. |
|
| ... | ... | \ No newline at end of file |
| 0 | +```csharp |
|
| 1 | +public override void PreExecuteReportSet(Izenda.AdHoc.ReportSetreportSet) |
|
| 2 | + { |
|
| 3 | + bool scheduler = AdHocSettings.CurrentUserName.Equals("DefaultAdministrator"); |
|
| 4 | + if (scheduler) |
|
| 5 | + { |
|
| 6 | + Filter f = new Filter("TenantID"); |
|
| 7 | + f.Value = LookupTenantIDFromUser(reportSet.UserName); //Write your own implementation of this method |
|
| 8 | + reportSet.Filters.AddHidden(f); |
|
| 9 | + } |
|
| 10 | + } //end method |
|
| 11 | +``` |
|
| ... | ... | \ No newline at end of file |