要求:分行显示Text


起初我的写法如下:
先从Address table tccom130中拿到text number tccom130.txta,然后执行下面的函数:
取得Address.Text1、Address.Text2、Address.Text3三行
extern domain tcmcs.str80 Address.Text1 | Address Text Line1
extern domain tcmcs.str80 Address.Text2 | Address Text Line2
extern domain tcmcs.str80 Address.Text3 | Address Text Line3
function get.Address.Text()
{
long lng,i,l1,l2
select tttxt010.text
from tttxt010
where tttxt010.ctxt = :tccom130.txta | Address Text
and tttxt010.clan = "2" | Language
and tttxt010.seqe = 1 | Line
selectdo
lng = len(strip$(tttxt010.text))
for i = 1 to lng step 1
if tttxt010.text(i;1) = chr$(13) then
if l1 = 0 then
l1 = i
else
if l2 = 0 then
l2 = i
endif
endif
endif
endfor
Address.Text1 = tttxt010.text(1;60)
if l1 <> 0 then
Address.Text2 = tttxt010.text(l1+1;60)
else
Address.Text2 = ""
endif
if l2 <> 0 then
Address.Text3 = tttxt010.text(l2+1;60)
else
Address.Text3 = ""
endif
selectempty
Address.Text1=""
Address.Text2=""
Address.Text3=""
endselect
}
可是程序老是报错,到baanboard上查找资料,发现了如下的简单应用:
You do not have to specify all the lines of text to be printed. Just include the text field (say tdpur040.txta "Header Text of PO") in the report and all the lines would automatically be printed in the report.
But there is a slight problem here, if the text is multi-line, it would block all otehr lines to be printed till all the lines of this text gets printed.
If you want specifically to print the text in say 50 col wide length, then query table tttxt010 where tttxt010.ctxt = tdpur040.txta and get the text tttxt010.text. Break it up and print.
最终,我只是把tccom130.txta这个字段放在report上面,测试通过。


订阅我的BLOG(RSS)