Page 1 of 1
Save restrictions
Posted: Fri May 04, 2007 9:34 am
by Stéphane
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
Posted: Fri May 04, 2007 9:57 am
by Edward
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.
Code: Select all
report.Dictionary.Restrictions.Add("Categories", StiDataType.DataSource, StiRestrictionTypes.DenyEdit);
report.Dictionary.Restrictions.Add("DataSource._ID", StiDataType.DataColumn, StiRestrictionTypes.DenyShow);
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.
Save restrictions
Posted: Fri May 04, 2007 10:25 am
by Edward
For also you can disable some buttons and menuitems in the Dictionary.
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();
Thank you.