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

Abort printing from GlobalOnCreate

edited October 2007 in RAP
In the Global On Create event I popup a form to collect information (via a
pass through function). I offer a cancel button and would like to not print
(nor preview) in this case.

procedure GlobalOnCreate;
begin
if not ShowDataForm( RangeFrom, RangeTo) then
DoNotPrint;
end;

What command can I use for DoNotPrint?

TIA,
Scott.

Comments

  • edited October 2007

    RB 9 introduced a new Report.OnInitializeParameters event that can be used
    to cancel a report (and to initialize parameters, show custom dialogs, etc).
    The event-handler includes a boolean parameter, aCancel, that can be set to
    true.

    example:

    procedure ReportOnInitializeParameters(var aCancel: Boolean);
    begin

    if not(some condition) then
    aCancel := True;



    end;

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.