Tuesday, August 10, 2010

Printing labels in Avery template

How to create label using Avery template? What is need?

A scenario where we have to print the employee visiting cards in which user needs 3x3 = 9(9 emp inf labels in one page) 4x20 = 80 (80 emp inf labels in one page).For the data need to be repeated across the sheet use the below logic.

Here it is use the following xml

<ADDRESSES>
<ADDRESS>
<COMPANY>1 Oracle Street</COMPANY>
<NAME>Redwood Shores</NAME>
<ADD1>CA</ADD1>
<ADD2>94065</ADD2>
</ADDRESS>
<ADDRESS>
<COMPANY>2 Oracle Street</COMPANY>
<NAME>Redwood Shores</NAME>
<ADD1>CA</ADD1>
<ADD2>94065</ADD2>
</ADDRESS>
<ADDRESS>
...
...
</ADDRESSES>


Use the following code in Template.

For 3 Columns Avery template design in RTF for 3x3 = 9 Fields

In the first shape add this

<?for-each@shape:/Root/Row[(position() mod 3) = 1]?><?Code?><?shape-offset-y:(position()-1)*72?><?end-for-each?>


In the second column shape add this
<?for-each@shape:/Root/Row[(position() mod 3) = 2]?><?Code?><?shape-offset-y:(position()-1)*72?><?end-for-each?>

In the third column shape add this
<?for-each@shape:/Root/Row[(position() mod 3) = 0]?><?Code?><?shape-offset-y:(position()-1)*72?><?end-for-each?>

For 4Columns Avery template design in RTF for 4x20 = 80 Fields

In the first shape add this

<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 1]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>

In the second column shape add this
<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 2]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>


In the third column shape add this
<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 3]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>


In the fourth column shape add this

<?for-each@shape:/main/DATA_RECORD[(position() mod 4) = 0]?><?Code?><?shape-offset-y:(position()-1)*36?><?end-for-each?>



Demo repeating frame for the data to repeat in avery labels


ForLoopOutside

___________________________________

ForLoopInside

Company

Name

Add1

Add2
InsideEnd

___________________________________
OutsideEnd


Tags defined for 4x20 = 80 Repeatation of data in an avery label.


ForLoopOutside = <?for-each:DATA_RECORD[position() mod 4=1]?>

ForLoopInside = mailto:?for-each@column:.%20%20following-sibling::DATA_RECORD[position()%3c4]?

Company =<??>

Name =<??>

Add1 =<??>

Add2 =<??>

InsideEnd = <?end for-each?>

OutsideEnd= <?end for?><?split-by-page-break:?>


Template for Avery tables to print


1 comment: