Save restrictions

Stimulsoft Reports.NET discussion
Post Reply
Stéphane
Posts: 74
Joined: Wed Dec 06, 2006 3:45 am
Location: Paris (France)

Save restrictions

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Save restrictions

Post 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.

Attachments
4.InheritanceSample.zip
(26.13 KiB) Downloaded 223 times
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Save restrictions

Post 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.
Post Reply