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

determining default paper

edited July 2001 in General
I have an application that is used in the USA, Europe and Asia. One problem
is that I do not know how to automatically switch to the default PaperName.
The result is that some users are prompted to insert a different paper into
their printer.

For example... I developed this program in the USA and we use US Letter as
the default paper. My European and Asian users use A4 as their standard
paper, of course. Most, but not all, European and Asian users are prompted
to put US Letter paper into their printers BY THE PRINTER!

How can I determine what the default paper is for a given printer and set my
reports accordingly?

- Rich Poletti
Columbia Sportswear Company

Comments

  • edited August 2001

    The following article is re-posted from the Printers thread of the Tech
    Tips newsgroup.

    Please note that if you change the paper size of the report, you may
    need to adjust the objects contained in the layout. You can statically
    position the objects so they will fit in the smallest supported width
    and height or you can write code to move the objects, or you may want to
    consider creating a different set of layouts that is optimized for each
    report.


    --------------------------------------------------
    Tech Tip: Windows Default Printer Settings
    ---------------------------------------------------

    1. Default Printer Name

    You can get the name of the computers default
    printer by accessing ReportBuilder's global
    printer list object - ppPrinters.


    uses
    ppPrintr;


    var
    lsPrinterName: String

    begin

    lsPrintername := ppPrinters.DefaultPrinterName;

    end;



    2. Default Printer Setup


    Place the following code in the OnClick event-handler
    of a button on a form. When the button is pressed
    a message will be displayed showing the default
    printer name and paper size.

    You can get the other document defaults via
    the TppPrinter.PrinterSetup properties.


    uses
    ppPrintr;

    var
    lPrinter: TppPrinter;

    begin

    lPrinter := TppPrinter.Create;

    lPrinter.PrinterName := ppPrinters.DefaultPrinterName;

    ShowMessage(ppPrinters.DefaultPrinterName + ': ' +
    lPrinter.PrinterSetup.PaperName);

    {assign default printer settings to a report}
    myReport.PrinterSetup := lPrinter.PrinterSetup;


    lPrinter.Free;

    end;


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2002
    "Nard Moseley (Digital Metaphors)" wrote in
This discussion has been closed.