Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Remove a button from preview

edited February 2011 in General
D7, RB 12.03

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.

Thanks,
Bob

Comments

  • edited February 2011
    Hi Bob,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2011
    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;



  • edited February 2011
    Hi Bob,

    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;



    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2011
    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;

  • edited February 2011
    PS: I tried ppReport1.Print and got the same results. The Email button
    still appears in preview tab.

  • edited February 2011
    Hi Bob,

    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;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.