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

How can i set paperid,name, length in beforeprint (brother label printer under nt)?

edited June 2001 in General
I use delphi 4.0, enterprise ed. repbuilder ver. 5.56. Label printer brother
printer p-touch 9200pc (continues feed label printer) latest driver 3.21.
Windows NT 4.0

I need to set paperid as well as papername, length / width immediatly before
print without your component reacting on the changes as described below?

Important!! this problem is only present on NT 4.0 (havent tried nt 2000
though), it works fine on win95/98/me.

I tried to use the beforeprintevent (on a reply from of Nard Moseley), but
upon setting paperwidth i get 'custom' in papersize/id and papername.

Fine, i thought i just set paperid as last options, but discovered that
papersize/id is readonly property and cannot be set by user. In the
modifications i tried below this worked rather fine.

(I know you can set papername, but this also changes the paperdimensions
(width) wich is fine on a normal printer, but not good on a label printer
with
continuous label feed where the papername of '12 mm' gives you the
options to specify any label length.).

After countless debug sessions i have found out that it proprably is
the way the custom format is used by brother driver. It dosen't use
paperheight to set label width to f.eks. 12 mm. I tried to modify
the rbuilder code to see how to change or implement a code that could
work under the brother driver , and got something that could work,
as this is not legal under your licence terms i cannot use this approach.
And
furthermore i cannot compile with any rap-enabled enduser applications as i
dont have the source for this module.

What can i do?

Best regards
Svend e. Tang
Chief programmer
Louis Poulsen El-teknik A/S
Denmark

Comments

  • edited June 2001

    1. Below is a tech tip on troubleshooting custom paper sizes for Win
    NT/2000.

    2. You can modify the source code and recompile with RAP as long as you
    do not change the interface section of the unit.

    3. Setting the PrinterName to a size other than 'Custom' means that the
    paper dimensions defined by the printer driver for the designated paper
    name will be used. This is required to support the Win API.


    ---------------------------------------------
    Article: Custom Paper Sizes on Windows NT
    ---------------------------------------------

    Win NT (and Win 2000) have a completely different printing architecture
    from Win 9x. This is particularly apparent when it comes to custom paper
    sizes.

    Windows NT handles paper sizes via Forms that are defined at the
    operating system level.

    1. Open the Windows NT printer panel
    2. Select File | Server Properties. The Print Server Properties dialog
    is displayed.
    3. From this dialog you can view all of the Forms currently defined for
    your machine.

    There are basic forms installed by the operating system. Additional
    forms may be added by printer driver installations or applications.

    ReportBuilder defines a Custom paper size as one that is NOT already
    defined and known to the printer driver. There are Win API calls
    ReportBuilder uses to retrieve a list of available paper sizes known to
    the printer driver.

    When printing a report, ReportBuilder first tries to find a pre-defined
    paper size it can use - one that matches the paper dimensions of the
    report. If it cannot find one, then it uses a Win API call to add/modify
    a Form named 'Custom'.

    Security Issues:
    ----------------

    Each printer installed to Win NT has security rights associated with it.

    1. Open the Windows Printer panel
    2. Select the printer icon for the printer
    3. Press the right mouse button to display the popup menu and select
    Properties.
    4. From the properties dialog select the Security tab
    5. From the Security tab, press the Permissions button
    6. A list of user groups and their associated rights will be displayed.
    7. The rights are: No Access, Print, Manage Documents, Full Control.

    *** A group must have at Manage Documents or Full Control in order to
    update forms.

    By default Administrators have full control. However Users by default
    have only Print rights.


    Troubleshooting Tips:
    ---------------------

    1. To test paper sizes you can run demo 121 in the main reports demo
    app.
    This demo displays a printer settings dialog and is very useful for
    testing printer drivers with various paper sizes.

    To test a paper size:

    a. Selecting the printer
    b. Specify the paper size
    c. press preview
    d. Press print to display the print dialog.
    e. From the print dialog press the Properties button to display the
    printer driver's built-in dialog. You should be able to verify the
    printer setting from here.

    These are the values communicated by RB to the printer. If
    these are set correctly then RB has done its job, the rest is up to the
    printer.

    2. Open the Windows printers panel. Select File | Server Properties. The
    Print Server Properties dialog is displayed. Select the Form named
    'Custom' and check that its dimensions are set to the correct values for
    your report.

    3. Try printing to this same paper size using other apps such
    as MS Excel and MS Word. If they cannot do it, then it is likely
    a limitation of the printer.

    4. Try downloading the latest printer driver from the manufacturers
    web site.

    5. Try testing with another printer.

    If test number 1 above works properly then e-mail
    support@digital-metaphors.com with the exact configuration
    you are using: Delphi version, ReportBuilder version,
    OS (NT4.0, Win95, Win98), and printer model.

    We can download the driver and try it out here.





    --
    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 June 2001
    Hi Svend,

    i

    avoid to change the interface section of any unit used by RAP and you should
    be able to re-compile RBE.

    regards,
    Chris Ueberall;
This discussion has been closed.