Page 1 of 1

Disabling Preview Functions

Posted: Thu Apr 10, 2008 8:40 am
by Brendan
Hi Stimulsoft.

I'd like to disable a number of preview functions depending on if a certain flag is true or false. I would like them disabled from the Preview window as well as from the preview tab in the designer.

Currently I have tried the following:

Code: Select all

bool allow = false;

StiService service = Stimulsoft.Report.StiConfig.Services.GetService(typeof(StiPreviewConfigService));
if (service != null)
{
    StiPreviewConfigService previewService = service as StiPreviewConfigService;
    previewService.ExportEnabled = allow;
    previewService.PrintEnabled = allow;
    previewService.SaveEnabled = allow;
    previewService.SendEMailEnabled = allow;
}
This works in that the buttons no longer appear as visible but for the clever users who press Ctrl+P or Ctrl+S this seems to still bring up the print dialog and the save dialog.

Is there a way I can disbale this from happening or am I using the wrong service or procedure.

Regards,
Brendan.

Disabling Preview Functions

Posted: Thu Apr 10, 2008 10:40 pm
by Vital
Hello Brendan,

Its a bug. We have fixed it. Patch will be included in build from 14 April.

Thank you.

Disabling Preview Functions

Posted: Fri Apr 11, 2008 4:33 am
by Brendan
Thanks Vital.