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

MailingLabels

edited August 2001 in General
I have setup a report that prints out mailing labels. Our client would
like to have the Zip Code printed in bold on a label at the beginning of
each new zip code group. How can this be done? I am using a calculated
field to copy the first five digits into, because they are stored with
all 9 digits in one field.

Thanks

Comments

  • edited August 2001
    Since your data is ordered by Zip, and you don't have a group in the report,
    you could use a TppVariable to cache the previous Zip to determine if the
    current Zip is different. Place a TppVariable in the detail band and set it
    to visible = false. Then in the DetailBand.AfterPrint event, assign the
    zipcode from the pipeline to the varaible's value. Then in the OnPrint event
    of the dbText, check to see if the current record value is different from
    the last and if so, then set the font to bold on the dbText.

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim:

    I am using a memo and populate it with the label information (used the demo
    example for this). I need the new zip code to print out on a label by itself
    prior to printing the addresses for the new group. Would setting a group band o
    the zip be beneficial?

    Thanks

  • edited August 2001
    You could create a group and use the Group.AfterGroupBreak event to detect
    when a new group is going to start.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim:

    I am using the group break event to print the new zip code as you suggested,
    however it prints in the memo field with the first address instead of on its own
    label. Would you like an example or demo of what I am doing?

    Thanks


  • edited August 2001
    I emailed you a simple report project created in RB 6.01, which bolds the
    first record of a group.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Jim:

    I have this part working. Based on your demo what I need is to print the words
    Zip Code on the label where the bolded record appears and move the bolded record
    ahead to print on the next label.

    Thanks

  • edited August 2001
    I've sent you another example which does this.

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    Jim:

    I just got around to trying your demo. It appears to do the breaking as I needed
    it to, however when I set the labels to print from left to right the word zip
    displays above the labels on the group break. It appears that the labels are
    still being printed top to bottom.

    Thanks

  • edited September 2001
    The label skipping approach works in a top to bottom traversal setting. The
    report engine was designed to work in a top to bottom traversal direction,
    it was never intended to print from left to right.

    However, it should be possible to skip labels forom left to right, although
    it is a little more complicated. An appraoch which will work, but not
    acceptable, is to print empty detail bands until the count is reached where
    the labels should begin printing. To do this it is possible to refresh the
    query so that it starts printing on the current record. A better approach
    may be to create a JITpipeline over a query. And for the first X records to
    skip, you could provide the report with extra data so that the report would
    genreate as it normally would. For the records which should be skipped, the
    detail band components could be set to visible = false. Once the number of
    detail bands which have printed, then the JITPipeline could begin returning
    actual data records from your query. There are some JITPipeline demos in
    the main reports demo project, if you haven't used them before. Basically,
    code the OnGetFieldValue event to return a field value from the query.

    function TForm1.JITMasterGetFieldValue(aFieldName: String): Variant;
    begin
    Result := Query1[aFieldName];
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    Jim:

    I guess I am lost on this one then. I always thought that mailing labels were
    printed left to right. They are currently doing it this way in MS Access 97
    using a group band and a access report and I thought with the flexability of
    Report Builder I could get the same results fairly easy.

    Thanks

  • edited September 2001
    Ok, I'll see if I can build a demo for you then.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.