Solved

Printing Labels

Posted on 2007-11-23
2
176 Views
Last Modified: 2013-12-24
I have a simple query for address label.  

select fname, lname, addr, city, st, zip
from demo

I want to print three addresses per row so that I can save trees.


Jone Doe                                 Sue Doe                          Jim Doe
1234 ABC Street                     1233 DEF Street              1233 GHI Street
Good City, PA 21043               Fun City, PA 21042          Great City, PA 21041      
 
Harry Doe                                Liz Doe                            Tim Doe
1234 ABC Street                     1233 DEF Street              1233 GHI Street
Good City, PA 21043               Fun City, PA 21042          Great City, PA 21041  

bla.....

How do you format this?

thx      
0
Comment
Question by:ethanjohnsons
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 20340674
One way is using MOD and the #queryName.CurrentRow# variable to start a new row every 3 columns.


<table width="600">
<tr><cfoutput query="yourQuery">
	<td>#fName#	#lName#<br>
		#addr#<br>
		#city#, #state# #zip#
	</td>
	<cfif currentRow MOD 3 EQ 0></tr><tr></cfif>
	</cfoutput>
</tr>
</table>

Open in new window

0
 

Author Comment

by:ethanjohnsons
ID: 20341427
it works great!

thx much
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question