Quantcast
Channel: Problem with mailing labels and line feed
Viewing all articles
Browse latest Browse all 8

Problem with mailing labels and line feed

$
0
0

I am trying to print mailing labels and suppress optional address lines to eliminate white space while maintaining label alignment.  This is what I am trying but it does not work.

 

I create a function that determines the length of a field (i.e. street) and increments a counter if the length is zero.  It also takes a second parameter that detremines whether to reset the counter.  I then use the function in the visibility each row of the label table.   Example iif(Code.LineLen(Fields!Street.Value)=0,True,False).  I place this on the visibility of each row except the last as that is City,State,Zip and is required.  On this last row the expession I use is

=Fields!city.Value &

", "& Fields!state.Value & " "& Fields!zip.Value & iif(Code.LineCount<5,StrDup(5-Code.LineCount,vbCRLF),"").  What this is intended to do is print a carraige return and line feed for every row that did not print.  Instead no line feeds occur.  I have verified that the Code.LineCount is indeed calculating correctly (I printed the value).  I've removed the conditional to make sure it has no issues but again nothing.  For clarification the code block I am using is this.

 

Public LineCount as Integer=0

 

Function LineLen(byval LineIn as string,byval IsFirst as boolean) as Integer
if IsFirst=True then

LineCount=1
end if
If len(LineIn)>0 then
LineCount=LineCount+1
end if
LineLen=Len(LineIn)
end Function

So if anyone either knows why the line feeds do not occur or a better way to handle this please let me know.  Thanks.

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images