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

Poblem when print a TppMemo on a matrix printer

edited December 2003 in General
Hi all,
i have a report that is designed for a matrix printer and in the detail band
i
have a tppmemo component.

The unit of this report is "printer pixel" and each band have the height set
to 100 or multiple of 100.

In the beforeprint of the detail band, to print the memo correctly on matrix
printer, i have inserted those statements :

If Memo1.Lines.count > 1 then
begin
Memo1.Height := (94 * Memo1.Lines.count);
Detail.Height := (100 * Memo1.Lines.count);
end;

The detail band have the printheighttype property set to phstatic and the
tppmemo have the stretch property set to false.

When the height of the memo in a page is greater than the space to the end
of the detail band, it is printed completely on the next page.

I have changed the printheighttype property to phdynamic and
the tppmemo.stretch property to true but in this case not all the memo lines
are printed on the matrix printer.

There is a way to print the first part of the memo in the rest of the page
but with a correct height (multiple of 100) and the rest in the next page,
and also in this page mantaining the the correct height (multiple of 100
pixel) ?

There is another way to print correctly a memo on a matrix printer ?

Thanks in advance

Massimo.

Comments

  • edited December 2003
    Hi Massimo,

    Printing to Dot Matrix printers is very tricky and printer specific. Be
    sure you are using the latest driver for your printer. Also, you may want
    to check out the Dot Matrix device included with TExtraDevices. I believe
    this device will just send text and escape codes to your printer rather than
    other items that could typically confuse your printer driver. Check it out
    at http://www.waler.com.

    -----------------------------------------------
    Article: Printing to Dot Matrix Printers
    -----------------------------------------------

    Dot matrix printers are natively line and character based. Most dot matrix
    printers can emulate graphical (i.e. pixel based) printing, but there is
    additional overhead which degrades printing speed.

    Some options for maximizing performance:

    1. Use native printer fonts.

    Each dot matrix printer normally has some built-in fonts. You can choose
    these fonts when using the ReportBuilder Report Designer. Choose File |
    PageSetup and select the dot matrix printer (or optionally use the object
    inspector to set Report.Printersetup.PrinterName). The fonts displayed in
    Report Designer's font drop down list located on the format toolbar will
    display the printer native fonts (indicated by a special printer icon next
    to the font name).

    2. Vertically position and size objects in 1/6 inch increments.

    A standard dot matrix printer can print 66 lines per 11 inch portrait page.
    This translates to a line height of 1/6 inch. Therefore the height of each
    band should be a multiple of 1/6 as should the size of the margins, the
    vertical position of each object etc.

    Tip: When designing the report, use the PrinterSetup property to specify a
    printer that contains 600 dpi. Then set Report.Units to PrinterPixels. Now
    100 pixes = 1/6 of inch when specifying the positions of objects in the
    layout.


    3. Keep the layout simple, avoid using graphics of any kind.

    Alternatives to using the dot matrix printer driver:

    1. Use the generic text printer driver.

    When using the generic text printer you will need to use the courier or
    courier new font and apply the layout techniques described above.

    2. Use ReportBuilder's ReportTextFile device output format.

    This ReportTextFile device can exports the report to a .txt file which you
    can then send to the printer. Demo dm0107.pas in the main reports demo app
    shows an example of printing a report to a .txt file and previewing the
    results.


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2003
    Hi Nico and thanks for the answer but perhaps you haven't understood my
    question.

    I have a report that is perfectly disigned for a dot matrix printer, and all
    the characters are printed correctly.

    The problem is that when i print a tmemo component i must use a vertical
    static dimension of the memo and of the detail band, because differently i
    lost some lines random.

    That said, if you have some trick to know for example when a memo will be
    printed on the next page or some other advice
    to modify this piece of code to mantain the correct heigth (as described in
    your articole "Printing to Dot Matrix Printers"), i will be gratefoul to
    you.

    If Memo1.Lines.count > 1 then
    begin
    Memo1.Height := (94 * Memo1.Lines.count);
    Detail.Height := (100 * Memo1.Lines.count);
    ...
    If meno1 goes to the next page then
    dosomething;
    ..

    end;


    Thanks in any case.

    Massimo.




This discussion has been closed.