I am replacing the email button with my own button and function. I know how to add my own button and function. How do I disable the default email button from the preview tab of the report.
I have the following code on the ppReport1PreviewFormCreate event. However, the email button still appears in the preview of the report. Any suggetions?
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject); begin TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False; end;
"Bob Tucker" wrote in message news:4d6135ce$1@mail....
I have the following code on the ppReport1PreviewFormCreate event. However, the email button still appears in the preview of the report. Any suggetions?
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject); begin TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False; end;
I have the code on the right procedure but you are correct, it is not getting executed. I open reports from templates in the database and then use the following to run them. It opens to the Preview tab so I am not sure why the event isn't firing. ppDesigner1.Show;
Code Below:
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject); begin TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False; end;
If you are loading templates, you are experiencing the same issue as you did with making the EmailSettings properties stick. Once you load a template, the event is no longer attached to the report.
To work around this issue you can either re-assign the event handler in the OnLoadEnd event or you can keep your events local to the reports (templates) by using RAP.
"Bob Tucker" wrote in message news:4d62c560$1@mail....
I have the code on the right procedure but you are correct, it is not getting executed. I open reports from templates in the database and then use the following to run them. It opens to the Preview tab so I am not sure why the event isn't firing. ppDesigner1.Show;
Code Below:
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject); begin TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False; end;
Comments
http://www.digital-metaphors.com/rbWiki/Output/Preview/Hide_Print_Button_on_Print_Preview
Note: Use the EmailButton property rather than the PrintButton.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
the email button still appears in the preview of the report. Any
suggetions?
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False;
end;
Are you certain this code is executing? Try placing a break point inside
the event to be sure.
In my testing with the exact same code, the email button was properly
hidden.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
"Bob Tucker" wrote in message news:4d6135ce$1@mail....
I have the following code on the ppReport1PreviewFormCreate event. However,
the email button still appears in the preview of the report. Any
suggetions?
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False;
end;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
getting executed. I open reports from templates in the database and then
use the following to run them. It opens to the Preview tab so I am not sure
why the event isn't firing.
ppDesigner1.Show;
Code Below:
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False;
end;
still appears in preview tab.
If you are loading templates, you are experiencing the same issue as you did
with making the EmailSettings properties stick. Once you load a template,
the event is no longer attached to the report.
To work around this issue you can either re-assign the event handler in the
OnLoadEnd event or you can keep your events local to the reports (templates)
by using RAP.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
"Bob Tucker" wrote in message news:4d62c560$1@mail....
I have the code on the right procedure but you are correct, it is not
getting executed. I open reports from templates in the database and then
use the following to run them. It opens to the Preview tab so I am not sure
why the event isn't firing.
ppDesigner1.Show;
Code Below:
procedure TfrmRBuilder.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppPrintPreview(ppReport1.PreviewForm).EmailButton.Visible := False;
end;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com