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

Email Button From Preview in Design mode

edited April 2007 in General
Any way to know the email button was clicked from the preview in design
mode. I try the code below which I found here. This only works in plain
preview mode and not in design preview.
uses
ppPrvDlg;

procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
begin
TppPrintPreview(ppReport1.PreviewForm).Toolbar.Items[1].OnClick :=
EmailOnClickEvent;
end;

Comments

  • edited April 2007
    Hi,

    For future reference, please use your full real name when posting to these
    newsgroups instead of your initials.

    Try using the OnTabChanged event to check if the preview is being viewed,
    then access the email button using the
    TppDesignWindow.PreviewManager.Previewer property...

    procedure TForm1.ppDesigner1TabChanged(Sender: TObject);
    var
    lPreview: TppPreview;
    begin

    lPreview := TppPreview(ppDesigner1.Form.PreviewManager.Previewer);

    if lPreview <> nil then
    lPreview.EmailButton.OnClick := EmailClickEvent;
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    Thanks Nick that works but I have to ask.
    Why is so important we use our real name? If is to verify my registration I
    can send you that on private email. I just do not want certain people
    finding me or what I do by just doing a google search.
This discussion has been closed.