字段怎么折行显示?
我有一个TABULAR风格的报表,有一个字符型的字段太长(最长在60个字符左右),纸张的宽度不够,我怎么试该字段折行显示,而其他的字段不变? 问题点数:35、回复次数:7Top
1 楼ldy(罗大佑)回复于 2002-11-25 13:35:55 得分 5
我觉得其他字段肯定也得跟着变高吧Top
2 楼songfrh(我们看海去)回复于 2002-11-25 13:41:58 得分 0
关注Top
3 楼Steve_csdn()回复于 2002-11-25 13:42:02 得分 5
1:行和列设置成自动调高。
2:列的水平滚动属性为false
3: 设置列高属性为以下表达式试试:
if(len(trim(折行列名))/30>1,(ceiling(len(trim(折行列名))/每行字节数))*行高,行高)
http://expert.csdn.net/Expert/topic/1035/1035455.xml?temp=.7882501
Top
4 楼dongquestion(书山有路勤为径)回复于 2002-11-25 13:44:37 得分 5
http://www.sybase.com.cn/cn/content/developer/exp_kfzly_kfzw_06.htmTop
5 楼emoam(十一狼)回复于 2002-11-25 13:55:56 得分 5
插入一个计算列,然后将其Visible属性设置为如下格式:
if (len( 字段名 ) < 7,0,1) //长度小于7,不显示;长度超过7,显示
原来的字段属性设置为:if (len( 字段名 ) > 7,0,1)Top
6 楼888888888888(888888888888)回复于 2002-11-25 20:14:18 得分 5
http://www.sybase.com.cn/cn/content/developer/exp_kfzly_kfzw_06.htmTop
7 楼arping(阿平)回复于 2002-11-26 18:24:46 得分 10
//函数名:f_wordwrap
//参数1:as_text 要被处理的正文
//参数2:ai_charincol 一行放多少个字符(不包括回车)
//返回:as_tex 处理过的行
int i,li_len,j,k,l,li_totalrow
char lch_char,lch_next
string ls_wrappedtext,ls_next,ls_prev,ls_string
li_len = len(as_text)
j=0 //记ASCII大于127的字符个数
k=0 //记每一行的字符数
l =1 //每一行起始字符在正文中的位置
li_totalrow = 0
ls_wrappedtext = ""
for i=1 to li_len
lch_char = mid(as_text,i,1)
if asc(lch_char) > 127 then
j++
k++
else
if lch_char = '~r' then
li_totalrow++
k++
ls_wrappedtext += mid(as_text,l,k)
j = 0
l += k
k =0
elseif lch_char = '~n' then //新行
k++
ls_wrappedtext += mid(as_text,l,k)
l +=k
k --
else
k++
end if
end if
if k >= ai_charincol then//如一行已超过最大长度,则自动折行
lch_next = mid(as_text,i+1,1)
ls_next = mid(as_text,i+1,2)
ls_prev = mid(as_text,i,2)
if lch_next = '~r' or lch_next = '~n' then
continue
elseif lch_next = '.' or lch_next =',' or lch_next ='?' or lch_next ='!' &
or lch_next =')' or lch_next =']' or lch_next ='}' or lch_next =';' &
or lch_next =':' or lch_next ='~'' or lch_next ='~"' then
if i <> li_len -1 then
continue
else
exit
end if
elseif ls_prev = ',' or ls_prev ='。' or ls_prev = '?' &
or ls_prev = '!' or ls_prev = '”' or ls_prev ='’' or &
ls_prev =')' or ls_prev = ';' or ls_prev = ':' or ls_prev = '、' then
if i <> li_len -1 then
continue
else
exit
end if
elseif ls_next = ',' or ls_next ='。' or ls_next = '?' &
or ls_next = '!' or ls_next = '”' or ls_next ='’' or &
ls_next =')' or ls_next = ';' or ls_next = ':' or ls_next = '、' then
if i <> li_len -2 then
j++
i++
k++
continue
else
exit
end if
else
if mod(j,2) = 0 then
ls_wrappedtext = ls_wrappedtext + mid(as_text,l,k) + '~r~n'
else
ls_string = mid(as_text,l,k -1)
ls_wrappedtext = ls_wrappedtext + mid(as_text,l,k -1) + '~r~n'
i --
k --
end if
j = 0
l += k
k = 0
li_totalrow ++
end if
end if
next
ls_wrappedtext = ls_wrappedtext + mid(as_text,l)
as_text = ls_wrappedtext
li_totalrow ++
return ls_wrappedtext
//end!Top




