<!DOCTYPE openRPTDef>
<report>
 <title>Shippinig Labels By S/O</title>
 <name>ShippingLabelsBySo</name>
 <description></description>
 <size>Letter</size>
 <landscape/>
 <topmargin>100</topmargin>
 <bottommargin>100</bottommargin>
 <rightmargin>100</rightmargin>
 <leftmargin>100</leftmargin>
 <querysource>
  <name>detail</name>
  <sql>SELECT sequence_value,
       cust_number,
       cohead_number,

formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || '  ' ||   cohead_shiptostate || '  ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address,           


       cohead_custponumber,
       cohead_shiptoname,
       cohead_shiptoaddress1,
       cohead_shiptoaddress2,
       cohead_shiptoaddress3,
       (COALESCE(cohead_shiptocity,'') || ' ' || COALESCE(cohead_shiptostate,'') || ' ' || COALESCE(cohead_shiptozipcode,'')) AS citystatezip
FROM cohead
&lt;? if exists("soitem_id") ?>
  JOIN coitem ON cohead_id = coitem_cohead_id
&lt;? endif ?>,
  custinfo, sequence
WHERE ( (cohead_cust_id=cust_id)
&lt;? if exists("labelFrom") ?>
 AND (sequence_value BETWEEN &lt;? value("labelFrom") ?> AND &lt;? value("labelTo") ?>)
&lt;? endif ?>
 AND (cohead_id=&lt;? value("sohead_id") ?>)
&lt;? if exists("soitem_id") ?>
 AND (coitem_id = &lt;? value("soitem_id") ?>)
&lt;? endif ?>
)
LIMIT &lt;? value("labelTo") ?>;
       </sql>
 </querysource>
 <section>
  <name>detail</name>
  <detail>
   <key>
    <query>detail</query>
   </key>
   <height>494</height>
   <label>
    <rect>
     <x>630</x>
     <y>25</y>
     <width>90</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <string>Order #:</string>
   </label>
   <field>
    <rect>
     <x>725</x>
     <y>9</y>
     <width>155</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>cust_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>800</x>
     <y>445</y>
     <width>36</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>Parameter Query</query>
     <column>labelTo</column>
    </data>
   </field>
   <text>
    <rect>
     <x>15</x>
     <y>119</y>
     <width>880</width>
     <height>55</height>
    </rect>
    <bottompad>0</bottompad>
    <font>
     <face>Arial</face>
     <size>36</size>
     <weight>bold</weight>
    </font>
    <left/>
    <top/>
    <data>
     <query>detail</query>
     <column>shipping_address</column>
    </data>
   </text>
   <field>
    <rect>
     <x>9</x>
     <y>65</y>
     <width>884</width>
     <height>50</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>36</size>
     <weight>bold</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>cohead_shiptoname</column>
    </data>
   </field>
   <field>
    <rect>
     <x>725</x>
     <y>40</y>
     <width>155</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>cohead_custponumber</column>
    </data>
   </field>
   <label>
    <rect>
     <x>640</x>
     <y>40</y>
     <width>80</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <string>P/O #:</string>
   </label>
   <field>
    <rect>
     <x>725</x>
     <y>25</y>
     <width>155</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <left/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>cohead_number</column>
    </data>
   </field>
   <field>
    <rect>
     <x>735</x>
     <y>445</y>
     <width>36</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <data>
     <query>detail</query>
     <column>sequence_value</column>
    </data>
   </field>
   <label>
    <rect>
     <x>630</x>
     <y>9</y>
     <width>90</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <right/>
    <vcenter/>
    <string>Customer #:</string>
   </label>
   <label>
    <rect>
     <x>775</x>
     <y>445</y>
     <width>16</width>
     <height>16</height>
    </rect>
    <font>
     <face>Arial</face>
     <size>10</size>
     <weight>normal</weight>
    </font>
    <hcenter/>
    <vcenter/>
    <string> of </string>
   </label>
  </detail>
 </section>
</report>
