Avery Labels

I have seen various postings on being able to use BIP with Avery label templates. Im not limited to Avery here, there are other templates out there too. I have recently been working with John and colleagues over in Oklahoma City who were desperate; desperate might be too strong a word but they needed, at least, to get BIP generating their address labels.

Problem was, existing solutions, my efforts so far have fallen into this category, would work for a page or even a couple but after that things started to slip down the page and you started to get addresses spanning labels and it degenerated into a big mess very quickly.

If you take a look at Avery's templates

Avery1.jpg

You'll notice that they put in the nice Word shapes to show you where the label is on the paper. Looks great and your mind, as a template developer falls immediately to using a shape file and manipulating it for a really groovy BIP template. Sadly, the shape manipulation support is not aware of margins and headers and footers. So it will keep repeating the label shape off the bottom of the page and on to the next. Its not an easy thing to address. I once spoke to Edward (RTF parser builder extraordinaire) about the shape support. They are not bound by the margins, etc so can be placed any where on the page leading to issues when you want repeat them down the page.

So the shape approach is out; I took a closer look at the Avery template.

Avery2.jpg

There is actually a table behind the scenes keeping the shapes in their place. Worth a look. I went down the path of a previous post, using a single row and a for-each loop. I ran into another problem with keeping rows on the page and getting addresses to run across and then down. That was out then.

During this time I was writing the old school cross-tabbing post. That got me thinking about another solution.

Rather than trying to work with a row of a table; how about a single cell and some cross tabbing tricks. Looking closer at the table:

Avery3.jpg

Avery4.jpg

We have that nasty spacer column to deal with. All we need is the top left cell with the spacer column. A little bit of table manipulating and I had a single cell made up of the top left cell extended by the spacer column. Graphic shows the modified top left cell and the next below with the spacer column still present.




If I can repeat that cell across the page and then down I will get the spacing I need to get the document to print on the label paper.

Here's the template:Avery5.jpg


Not much to it really, just a couple of neat tricks with some help from template meister Hok-Min. Heres the data structure we were working with:

<ADDRESSES>
<ADDRESS>
<STREET>1 Oracle Street</STREET>
<CITY>Redwood Shores</CITY>
<STATE>CA</STATE>
<ZIP>94065</ZIP>
</ADDRESS>
<ADDRESS>
<STREET>2 Oracle Street</STREET>
<CITY>Redwood Shores</CITY>
<STATE>CA</STATE>
<ZIP>94065</ZIP>
</ADDRESS>
<ADDRESS>
...
...
</ADDRESSES>

Here are the fields and their contents:













FE<?for-each:ADDRESS[position() mod 3=1]?>
FEC<?for-each@column:. | following-sibling::ADDRESS[position()<3]?>
STREET <?.?>
EFE <?end for-each?>
EFE<?end for-each?>
The first loop outside of the cell is looping over the ADDRESS in groups of three. The inner loop uses the @column to repeat the column (actually just the cell) the:
 
  . | following-sibling::ADDRESS[position()<3]

command, has the loop only looping triplets of columns across the page. We check that the following record number in the loop is less than 3.

I use <?.?> to just drop in the complete ADDRESS block ie all of its children in one go. you could equally drop in the individual fields too. One word of advice; you may need to adjust the font size to get the correct number of rows to show on each page. The template I was working with was 3x10 and needed 9 point font for Calibri. Arial needed to be 8 point.

If you're interested you can get the RTF template and some sample data for the 3x10 Avery label layout
here
.

Comments:

Here is a sample, i have fixed avery http://winrichman.blogspot.com/2009/10/avery-label-print-template.html http://forums.oracle.com/forums/thread.jspa?messageID=3807644�

Posted by Vetri on December 19, 2009 at 11:16 PM MST #

I like the blog, but could not find how to subscribe to receive the updates by email. Can you please let me know?

Posted by Samantha Brian on March 16, 2010 at 11:28 AM MDT #

Thanks Tim for this nice post. What output format would you recommend for this? PDF of RTF? When I tried RTF output, the row heights are enforced to 1", for many rows its less than that!! When I tried PDF output, there were two problems: 1. the header space is more than the avery template 2. each columns are slightly smaller than the avery template I was using oracle ebiz 11.5.10 xml publisher to do this. Do you know why this is happening and know of any workaround or solution? Thanks, Binish

Posted by Binish Gopal on July 28, 2010 at 03:55 AM MDT #

Trailers Coming SoonResident Evil Afterlife, n a world ravaged by a virus infection, turning its victims into the Undead, Alice (Milla Jovovich), continues on her journey to find survivors and lead them to safety. Her deadly battle with the Umbrella Corporation reaches new heights, but Alice gets some unexpected help from an old friend. A new lead that promises a safe haven from the Undead takes them to Los Angeles, but when they arrive the city is overrun by thousands of Undead – and Alice and her comrades are about to step into a deadly trap.

Posted by CouncilMan on August 08, 2010 at 02:19 PM MDT #

So far for me this was my favorite in the series... though none were much good haha!

Posted by resident evil online on September 20, 2010 at 06:06 AM MDT #

Hey, awesome website. I actually came across this on Yahoo, and I am happy I did. I will definately be coming back here more often. Wish I could add to the conversation and bring a bit more to the table, but am just absorbing as much info as I can at the moment. Thank You watch movies online

Posted by Rico Finnel on September 23, 2010 at 11:10 AM MDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today