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

How to set up Reports for a labelprinter with endless Paper rolls?

edited October 2013 in General
Hi,

i need to design an Report for a Labelprinter (Brother Labelprinter TD-4000)
and i cant figure out how to set up the printer and page breaks...

My Main Report has one Subreport and i need every Subreport on one seperate
Page - but with dynamic Page-Lengths.

the report looks like:


-> Header
-> Detail
-> Subreport
-> Detail line 1
-> Detail line 2
-> Detail line 3
================ Page Break (Labelwriter auto-cut)
-> Subreport
-> Detail line 1
-> Detail line 2
-> Detail line 3
-> Detail line 4
-> Detail line 5
================ Page Break (Labelwriter auto-cut)


How to achieve this?


Thanks,
Erwin

Comments

  • edited October 2013

    Here is an rbWiki article with details for printing to continuous paper..

    http://www.digital-metaphors.com/rbWiki/Output/Printer/Continuous_Paper



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2013

    Yes, i've seen this before - but when im doing this my Labelprinter cuts
    after every line...

    This is my Subreport:

    http://prntscr.com/1xh69i

    and i need one Pagebreak in each Group-Footer[0], regardless how much
    detailrecords are in there...


    Thx,
    Erwin



  • edited October 2013
    Hi Nard,

    Is there any way to supress Formfeeds in Title/Header/Details Bands?

    Or any way to supress the automatic Pagebreak at all?

    I need an solution for dynamic Page-Length, with only ONE Formfeed after
    each Report (or Subreport, or by RAP...)

    The Report prints on self-adhesive endless Paper Rolls and is used to stick
    on a Package.
    It contains:

    [in Header]
    Order-Nr & Package-Nr
    Sender
    Recipient

    [in Group-Header 0]
    Order-Position-Text

    [in Detail]
    amount, Item-Nr and Item-Name


    I need one Page-Break in Group-Footer 0 - or in Subreport End...
    (just don't based on Paper-Size...)


    TIA
    Erwin



  • edited October 2013
    Erwin,

    The real issue here is that you want to control the paper cut. The solution
    is to first configure the printer settings to turn off auto-cut. Then
    implement report event-handler code to send a printer escape command to cut
    the paper as needed.


    1. Configure Printer Settings

    From the object inspector set the Report.PrinterSetup.PrinterName to the TD
    4000 printer. Locate the PrinterSetup DeviceSettings property and press the
    ... button to display the printer's properties dialog. Turn off auto-cut.

    2. Send Escape command to cut paper

    Implement the OnPrinterDeviceStateChange event. This event receives a
    StateChange parameter that indicates before/after start/end job, start/end
    page etc. For details see TppProducer.OnPrinterDeviceStateChange in the
    RBuilder help. The code will look something like this...

    uses
    ppTypes;

    procedure Form1.ppReport1OnPrinterDeviceStateChange(Sender: TObject;
    aStateChange: TppDeviceStateChangeType);
    begin
    if (aStateChange = dsBeforeEndPage) then
    if (Need to cut paper)
    ppReport1.Printer.SendEscape('escape code here');

    end;

    3. Here is a doc on escape codes I found for the TD4000 printer...

    http://welcome.solutions.brother.com/BSC/public/files/dlf/docp000579/cv_td4000_eng_escp_120.pdf



    Best regards,

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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2013
    Hi Nard,

    thanks for your answer.

    i will try this tomorrow and i guess it may work in combination with an
    (own) RAP-Function that sets the "need to cut" flag.

    - Erwin
  • edited October 2013
    Report.Printer.SendEscape can be called from RAP. However, you might want to
    implement it inside a built-in RAP function to provide a re-usable function
    that can be called from other reports.

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

    Best regards,

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