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

Problem with PrinterSetup

edited February 2007 in General
I use the follow code und want to printout the dokument at the Printer
"varPrinterName".
But the Report printed allways on the default Printer.
What must i do, do printout to the selected printer?

ppArchiveReader1.PrinterSetup.PrinterName:=varPrinterName;
ppArchiveReader1.ShowPrintDialog:=true;
ppArchiveReader1.AllowPrintToFile:=false;
ppArchiveReader1.PrinterSetup.Copies:=1;
ppArchiveReader1.PrinterSetup.Collation:=true;
ppArchiveReader1.Print;

Comments

  • edited February 2007
    hi,

    try this:

    use combobox to capture the name of the printer:

    uses Printers;
    .....
    .....
    ComboBox1.Items.Assign(Printer.Printers); // assign the name of printer
    to combobox
    .....
    ppReport.PrinterSetup.PrinterName:=ComboBox1.Text; // before print set
    the printer name



    please select the printername by combobox and print your report.

    i think all is ok.








    --- posted by geoForum on http://delphi.newswhat.com
  • edited February 2007

    Try using the ArchiveReader.OnInitialPrinterSetup event. The ArchiveReader
    works a little differently because the Page.PrinterSetup properties that are
    stored with each page. The OnInitializePrinterSetup event occurs after the
    file has been opened and the Page.PrinterSetup has been read for the first
    page.

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

    Best regards,

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