好久好久好久没有写baan的4GL的程序了,因为所有开发都给Global去做,而我们site没有权限去做了。上周接到case要把Address code的Text也显示在invoice report上,因为这个打印发票的session是我开发的,现在只能我来做了。
要求:分行显示Text
起初我的写法如下:
先从Address table tccom130中拿到text number tccom130.txta,然后执行下面的函数:
取得Address.Text1、Address.Text2、Address.Text3三行
<br/><br/> extern domain tcmcs.str80 Address.Text1 | Address Text Line1<br/> extern domain tcmcs.str80 Address.Text2 | Address Text Line2<br/> extern domain tcmcs.str80 Address.Text3 | Address Text Line3<br/><br/>function get.Address.Text()<br/>{<br/> long lng,i,l1,l2<br/> select tttxt010.text<br/> from tttxt010<br/> where tttxt010.ctxt = :tccom130.txta | Address Text<br/> and tttxt010.clan = "2" | Language<br/> and tttxt010.seqe = 1 | Line<br/> selectdo<br/><br/>lng = len(strip$(tttxt010.text))<br/>for i = 1 to lng step 1<br/>if tttxt010.text(i;1) = chr$(13) then<br/>if l1 = 0 then<br/>l1 = i<br/>else<br/>if l2 = 0 then<br/>l2 = i<br/>endif<br/>endif<br/>endif<br/>endfor<br/>Address.Text1 = tttxt010.text(1;60)<br/>if l1 <> 0 then<br/>Address.Text2 = tttxt010.text(l1+1;60)<br/>else<br/>Address.Text2 = ""<br/>endif<br/>if l2 <> 0 then<br/>Address.Text3 = tttxt010.text(l2+1;60)<br/>else<br/>Address.Text3 = ""<br/>endif<br/><br/> selectempty<br/> Address.Text1=""<br/> Address.Text2=""<br/> Address.Text3=""<br/> endselect<br/>}<br/>
可是程序老是报错,到[URL=http://www.baanboard.com]baanboard[/URL]上查找资料,发现了如下的简单应用:
<br/>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. <br/>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.<br/>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.<br/>
最终,我只是把tccom130.txta这个字段放在report上面,测试通过。
Hello Troy,
在xihome上看你的帖,总有一种似曾相识的熟悉感,来到你的主页才发现真的是你。
我是NJ Flex的,去上海出差时见过的。是不是已经忘记了?先打个招呼吧
Thanks for you feedback,where are you right now? did you leave Flex?
yes, i have away from flex, and now i am in nanjing FIAT (old name: nanya)who aslo use Baan ERP.
if want to buy car , i will have the discount ^_^
Troy,
Thanks for your share.
Can I ask you more about BaaN?
Arking, actually i need a free car, not a discout car.
haha, i’m kidding.
JM, Who are you? can you let me know more?
Hi Troy,
I’m from village, I heard that you are good at BaaN
application, then, Now, I am learning about BaaN.
So, I hope can make a friend with you.
JM,glad to see your rapid reply and to be a friend of you.
Baan is one of my favorite ERP software, i am good at internet, not Baan.but i am very happy to share the Baan knowledge with you.
Have a nice day, i have to work now.
Good morning Troy ,
as now i face a problem with b2win ,it can not be converted to office 2003, maybe program too old . could you give a hand how and where to take out the program?and could you share the flex b2win with me ?
thanks advance
Hello, Tony
请问你在做此session时, 若在text editor中输入超过一行的资料,
会不会有部份文字被截断而无法印出的现象?
我目前遇到的状况是第一行可以正常印出, 但之后有可能会被截掉?
还想不到可能的原因, 烦请提供你的见解