marcioav
Posts: 5
|
Posted: 02/17/2008, 7:27 AM |
|
how do I to generate Address Labels templates in Letter format (1.333 x 4 inches) paper and 14 Address Labels divided is 2 columns (7 each)?
Tks
Marcio
_________________
Marcio/Brazil |
|
|
rstewart
Posts: 17
|
Posted: 02/19/2008, 7:37 AM |
|
If you are requiry Avery labels:
Printing from web pages usually requires CSS styles to format labels
note: browser margins and such can override positionings.
Try this ASP code example using MS excel to get the drift of things.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Avery 5160 Labels</title>
<!------------------ Avery 5160 template ------------------>
<style type="text/css">
body {
background-color:white;
font-size: 8pt;
font-family:Arial;
margin-top: .334in;
}
/* inner page dimensions */
table {
width:8.13in;
margin-left:.08in;
table-layout:fixed;
page-break-after: always
}
.label {
/* border-style:solid; border-width:1px; */
font-size: 8pt;
width:2.625in;
height:1in;
border-collapse: collapse;
text-align:center
}
/* space between labels */
.column {
font-size: 1pt;
width:.255in;
}
</style>
</head>
<%
'''' change DBQ and DefaultDir to your website folder ''''
Set cn = Server.CreateObject("ADODB.connection")
cn.Open "Driver={Microsoft Excel Driver (*.xls)}; DriverId=790;" &_
"DBQ=C:\InetPub\websites\avery\UPC Labels.xls; DefaultDir = C:\InetPub\websites\avery\"
Set rs=Server.CreateObject("ADODB.recordset")
''' IMPORTANT - my_range: EXCEL > insert > Name > Define (search google on EXCEL cell ranges)
rs.open "SELECT * FROM my_range", cn, 3, 1
elements = CInt(rs.recordcount)
redim temp(elements)
label=0
pages=0
rs.movefirst
for i = 1 to elements
if i mod 30 = 0 then pages = pages + 1
'''' add your fields names below ''''
temp(i) = rs("name") & "<br>" rs("address")
rs.movenext
next
rs.Close
cn.Close
Set cn = Nothing
Set rs = Nothing
%>
<body topmargin="0" leftmargin="0">
<%
on error resume next
for r = 0 to pages
if r > 0 then page = page + 30
%>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="label"><%=temp(page+1)%> </td>
<td class="label"><%=temp(page+2)%> </td>
<td class="label"><%=temp(page+3)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+4)%> </td>
<td class="label"<%=temp(page+5)%></td>
<td class="label"><%=temp(page+6)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+7)%> </td>
<td class="label"><%=temp(page+8)%> </td>
<td class="label"><%=temp(page+9)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+10)%> </td>
<td class="label"><%=temp(page+11)%> </td>
<td class="label"><%=temp(page+12)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+13)%> </td>
<td class="label"><%=temp(page+14)%> </td>
<td class="label"><%=temp(page+15)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+16)%> </td>
<td class="label"><%=temp(page+17)%> </td>
<td class="label"><%=temp(page+18)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+19)%> </td>
<td class="label"><%=temp(page+20)%> </td>
<td class="label"><%=temp(page+21)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+22)%> </td>
<td class="label"><%=temp(page+23)%> </td>
<td class="label"><%=temp(page+24)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+25)%> </td>
<td class="label"><%=temp(page+26)%> </td>
<td class="label"><%=temp(page+27)%> </td>
</tr>
<tr>
<td class="label"><%=temp(page+28)%> </td>
<td class="label"><%=temp(page+29)%> </td>
<td class="label"><%=temp(page+30)%> </td>
</tr>
</table>
<%
next
%>
</body>
</html>
_________________
looking for work in a sunny country. |
|
|
|