|
Thanks for this Karen - you never know when it will
come in handy!
----- Original Message -----
From: [EMAIL PROTECTED]
Sent: Monday, August 23, 2004 11:43 AM
Subject: [RBG7-L] - Re: Suppressing blank lines in mailing
labels John: I really miss the 6.5++ "line compression" in labels. I would often create a report as a 8 1/2 x 11" label to be able to easily do this. Although a stored procedure and ifnull/ifexists is easy enough for an address label (because you have at most 3 or 4 lines), what would you do if you had 12? I'm doing a list for my high school reunion where every student will have a name, but then any of the next 12 data items could be blank. Could you imagine the "if" construction for that? I decided to create a temp table with the name field, then 12 columns named Line1, Line2, etc. with a NOTE datatype. My program steps through each piece of data and fills in the "next" column of data. I'll post my code below in case anyone would ever find this useful. Karen -- code is stripped of usual beginning and ending cleanup, initialization, etc. DECLARE C1 CURSOR FOR SELECT + StudentID,Fullname,MarriedName,Address,email,+ Hobbies,Occupation,GrandChildren, <etc., etc.> + FROM students OPEN c1 WHILE 1 = 1 THEN FETCH C1 INTO vid, vfullname, vmarriedname, vaddress, vemail, + vhobbies, voccupation, vgrand, <etc.> IF SQLCODE = 100 THEN BREAK ENDIF SET VAR vloop INTEGER = 2 INSERT INTO tmpbooklet (studentid, line1) VALUES .vid, .vfullname IF vaddress IS NOT NULL THEN SET VAR vcolumn = ('Line' + CTXT(.vloop) ) UPDATE tmpBooklet SET &vcolumn = .vaddress WHERE studentid = .vid SET VAR vLoop = (.vLoop + 1) ENDIF IF vemail IS NOT NULL THEN SET VAR vcolumn = ('Line' + CTXT(.vloop) ) UPDATE tmpBooklet SET &vcolumn = .vemail WHERE studentid = .vid SET VAR vLoop = (.vLoop + 1) ENDIF IF voccupation IS NOT NULL THEN SET VAR vcolumn = ('Line' + CTXT(.vloop) ) UPDATE tmpBooklet SET &vcolumn = .voccupation WHERE studentid = .vid SET VAR vLoop = (.vLoop + 1) ENDIF -- YOU GET THE IDEA! ENDWHILE > Thanks Razzak, I am familiar with the process of |
- [RBG7-L] - Re: Suppressing blank lines in mailing labels A. Razzak Memon
- [RBG7-L] - Re: Suppressing blank lines in mailing la... John Engwer
- [RBG7-L] - Re: Suppressing blank lines in mailing la... A. Razzak Memon
- [RBG7-L] - Re: Suppressing blank lines in mailing la... Lawrence Lustig
- [RBG7-L] - Re: Suppressing blank lines in mailing la... David M. Blocker
- [RBG7-L] - Re: Suppressing blank lines in mailing la... John Engwer
- [RBG7-L] - Re: Suppressing blank lines in mailing la... KarenTellef
- David M. Blocker
