1. If you have multiple reports on different forms inside the same applicaiton, your best option would be to create a preview plugin, enabling Email when a Report is viewed. You could override the BeforePreview routine and add something like the following...
Report.EmailSettings.Enabled := True;
2. If your reports are saved in an end-user database, you can use the Template.OnLoadEnd event to set the Report.EmailSettings.Enabled property after the template has been loaded.
Yes I have tried this and it works like a charm . Be sure you are calling inherited and that you are successfully registering the custom preview plugin. If you place a stop inside this event, is the code being executed.
Comments
1. If you have multiple reports on different forms inside the same
applicaiton, your best option would be to create a preview plugin, enabling
Email when a Report is viewed. You could override the BeforePreview routine
and add something like the following...
Report.EmailSettings.Enabled := True;
2. If your reports are saved in an end-user database, you can use the
Template.OnLoadEnd event to set the Report.EmailSettings.Enabled property
after the template has been loaded.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks, but just doing this:
procedure TMyPreviewPlugin.BeforePreview;
begin
// inherited;
Report.EmailSettings.Enabled:=True;
end;
Still dioesn't show the email button.
Ken
Try the following...
procedure TMyPreviewPlugin.BeforePreview;
begin
inherited;
Report.EmailSettings.Enabled := True;
EmailButton.Visible := Report.EmailSettings.Enabled; //True;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Have you tried this because it doesn't work
Ken
Yes I have tried this and it works like a charm . Be sure you are calling
inherited and that you are successfully registering the custom preview
plugin. If you place a stop inside this event, is the code being executed.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Maybe its the units that are needed to be included. Would you mind sending
me the project?
Ken
http://www.digital-metaphors.com/tips/EnableEmailButton.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Many thanks, that works fine. I'll have to compare it to the one I did at
home.
Ken
Duh, didn't add the plugin to the project! All fine now thanks.
Ken