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

Mailing label

edited December 2006 in General
I have created a mailing label report consists of 2 coolumns.
The format of the mailing label sheet should be conform the standard of
38937:
Top margin - 15 mm
Bottom margin - 15 mm
Left margin - 5 mm
Right margin - 5 mm

Distance between column - 4 mm
Height of each label - 38 mm

In my report, I set the height of column header and column footer to 15 mm,
also the height of the detail band to 38 mm.

However, for the first top couple of labels the text is fine. But from the
middle onward, the text seems shift towards the top of each label.

Comments

  • edited December 2006
    Hi Alan,

    Instead of createing this label template manually, I would recommend adding
    this as a custom label template to the label wizard built-in to
    ReportBuilder. This is designed to handle the type of label you are using
    much more gracefully. Take a look at the following article for more
    information.

    --------------------------------------------------
    Article: Adding Custom Labels to the Label Wizard
    --------------------------------------------------

    The ReportBuilder Label Wizard contains an extensible architecture that
    enables additional sets of labels to be created and registered.

    Creating new label sets is a very simple process.

    1. Open ppLabelDef.pas located in RBuilder\Source.

    This unit contains the TppLabelSet class which is the abstract ancestor
    class for all label sets. This class contains the necessary logic to
    translate label specs into report specs.

    Descending from this class are two additional classes TppLaserJetLabels and
    TppDotMatrixLabels. All label sets should descend from one of these two
    classes.

    2. Open ppAvStd.pas located in RBuilder\Source

    This unit contains the TppAveryStandardLaserJetLabels class and the
    TppAveryStandardDotMatrixLabels class.

    The label specs are declared as const arrays, with each string element of
    the array representing a specific type of label.

    Example code from ppAvStd.pas:

    const
    caAveryStdLaserJet: array [0..157] of String = (

    { LabelType, Name,
    Width, Height, MarginTop, MarginBottom, MarginLeft, MarginRight,
    Orientation, RowSpacing, Units, Columns, ColumnPositions }

    'Address,2160 - Mini,2.63,1,4.5,5,0.5,0,0.81,0,0,0,1,0',
    'Address,2162 - Mini,4,1.33,4.5,5,0.5,0,0.12,0,0,0,1,0',


    As you can see in the above example code, each label spec consist of a comma
    delimited string that describes the dimensions of the label and the label
    sheet.

    3. The LabelSet class defintion for AVeryStdLaserJet labels consist of three
    methods, each containing a single line of code. These are shown below:


    {------------------------------------------------------------------------------}
    { TppAveryStdLaserJetLabels.Product }

    class function TppAveryStdLaserJetLabels.Product: String;
    begin
    Result := 'Avery Standard';
    end; {class function, Product}

    {------------------------------------------------------------------------------}
    { TppAveryStdLaserJetLabels.Count }

    class function TppAveryStdLaserJetLabels.Count: Integer;
    begin
    Result := High(caAveryStdLaserJet) + 1;
    end; {class function, Count}

    {------------------------------------------------------------------------------}
    { TppAveryStdLaserJetLabels.GetLabelDef }

    class function TppAveryStdLaserJetLabels.GetLabelDef(aIndex: Integer):
    String;
    begin
    Result := caAveryStdLaserJet[aIndex];
    end; {class function, GetLabelDef}


    4. The initialization/finalization sections at the bottom of the unit
    contain the RegisterLabelSet calls to make the label set known to the Label
    Wizard.


    5. ppAvIntl.pas located in RBuilder\Source contains the definitions for
    Avery International Labels.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2006
    Hi,

    Just wonder the number of values in the array do not match the number of
    columns in the array definition ?
    There are 13 fields in the definition but 14 values in the 'Address,
    2160,......'
  • edited December 2006
    Hi Alan,

    Sorry about that. The comments were incorrect for some versions of
    ReportBuilder. This has been fixed for the latest version. It should
    read...

    { LabelType, Name, Width, Height, PaperWidth,
    PaperHeight, MarginTop, MarginBottom, MarginLeft, MarginRight,
    Orientation, RowSpacing, Units, Columns, ColumnPositions }

    The ColumnPositions entry is optional and will take the 14 to the
    (14+Columns) slots in the list.


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.