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

problems with 2nd print

edited September 2002 in General
Okay, when printing a document I need to print another copy of that
document.

in RB 6.03 it worked perfectly,

but with the new RB 7 the second document gets a cancel form, which in my
opinion is the printdialog, but when I press the cancel button it still
prints the documents ( which is good ), but I want it to work normally. any
ideas ? :

Code :
with PrinterSetup do
begin
PrinterName := IniKassaPrinter;
BinName := IniKassaBin;
DocumentName := 'Kassabon : '+FactNr;
end;
Print;
Totaalbedrag := 0;
with PrinterSetup do
begin
PrinterName := IniKassaKopiePrinter;
BinName := IniKassaKopieBin;
DocumentName := 'Kassabon : '+FactNr+' Kopie' ;
end;
Print

the strings contain valid printernames as given from the
printersetup.printernames object

is this a bug, or is there some code change I forgot ??

Comments

  • edited September 2002
    Can you send us a test project that shows this problem? Send it to
    support@digital-metaphors.com

    Here's my code that worked fine.

    procedure TForm1.Button1Click(Sender: TObject);
    begin

    ppReport1.PrinterSetup.PrinterName := '\\DM266\HP LaserJet 5';
    ppReport1.PrinterSetup.BinName := 'Auto Select';
    ppReport1.PrinterSetup.DocumentName := 'Kassabon : '+'1';
    ppReport1.Print;

    ppReport1.PrinterSetup.PrinterName := '\\DM180\Lexmark Optra Se 3455';
    ppReport1.PrinterSetup.BinName := 'AutoSelect';
    ppReport1.PrinterSetup.DocumentName := 'Kassabon : '+'1'+' Kopie' ;
    ppReport1.Print

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002
    as in my mail, but here again for the newsgroup :


    the problem occurs only when not showing the printerdialog and do showing
    the canceldialog. the devicetype is set to dtPrinter.

    is there gonna be a bugfix for this ??

    futher my congratulations to the new version, the adjustable previewscreen
    is GREAT!
    no more paper waste and i can create lazy users.....

    yours truly,

    Paul Menheere
    For-A-Sake


  • edited September 2002
    Thanks for the example. Many of the data access components were custom, so
    the form did not load.

    However, I did put together an example that prints a report directly to the
    printer while showing the cancel dialog. Seems to work fine.

    How does your example run if you disable all the event handlers?

    --
    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited September 2002
    try printing it twice with your button1click


    and I mean just copy-paste the 3 lines of codes behind


    so you would get this :

    ppReport1.ShowPrintDialog := False;
    ppReport1.ShowCancelDialog := True;
    ppReport1.Print;
    ppReport1.ShowPrintDialog := False;
    ppReport1.ShowCancelDialog := True;
    ppReport1.Print;

    et voila, an blank canceldialog....



    Yours truly,

    Paul Menheere
    For-A-Sake


This discussion has been closed.