Home Devices

conditionally disable print dialog copies

edited January 2003 in Devices
Hi
I've spent a while thinking about this, but I can't seem to figure out how
to use TppReport.PrinterSetup to
either determine the "calling" report or enable/disable the print dialog
copies based on the "calling report"
More details, Please...
Thanks
Bob.


project first)

Comments

  • edited January 2003
    If you know you are making the call to ppReport1.Print and ppReport2.Print,
    then place register calls around it to register one dialog or the other.
    Otherwise, register the standard print dialog TppPrintDialog. Is this
    possible with your code? If you are using templates, then use the
    Report.Template.OnLoadEnd event handler to make a check to see if you
    should register an alternate dialog or the default dialog form class.

    TForm1.btnppReport1Click;
    begin
    ppReport1.Print; {default print dialog}
    end;

    TForm1.btnppReport2PrintClick;
    begin

    ppRegisterForm(TppCustomPrintDialog, TmyNoCopiesPrintDialog);

    ppReport2.Print; {uses the custom print dialog with no copies shown}

    ppUnRegisterForm(TppCustomPrintDialog);

    ppRegisterForm(TppCustomPrintDialog, TppPrintDialog);
    end;

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.