Hello !
I added some restrictions to report dictionary. When I save the report, the dictionary is well saved but not the restrictions. Is there a way to do this because I don't want that the final user can modify my dictionary.
Thanks in advance.
Save restrictions
Save restrictions
There exists two ways of preventing modifying the Dictionary by the end-user.
1. In the code after loading the report to add restrictions for each object of the Dictionary.
2. Use inheritance of the reports. In that case you will need to create two reports: base with the Dictionary and the second with the items which the user can modify.
How to use the inheritance please see in the sample application.
Thank you.
1. In the code after loading the report to add restrictions for each object of the Dictionary.
Code: Select all
report.Dictionary.Restrictions.Add("Categories", StiDataType.DataSource, StiRestrictionTypes.DenyEdit);
report.Dictionary.Restrictions.Add("DataSource._ID", StiDataType.DataColumn, StiRestrictionTypes.DenyShow);
How to use the inheritance please see in the sample application.
Thank you.
- Attachments
-
- 4.InheritanceSample.zip
- (26.13 KiB) Downloaded 222 times
Save restrictions
For also you can disable some buttons and menuitems in the Dictionary.
Thank you.
Code: Select all
StiDictionaryPanelService dictionaryService = null;
foreach (StiPanelService service in StiConfig.Services.GetServices(typeof(StiPanelService), false))
{
if (service.GetType() == typeof(StiDictionaryPanelService))
{
dictionaryService = service as StiDictionaryPanelService;
}
}
dictionaryService.ShowDeleteButton = false;
dictionaryService.ShowDeleteMenuItem = false;
dictionaryService.ShowEditButton = false;
dictionaryService.ShowEditMenuItem = false;
report.Design();