Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 29th June 2017, 10:14
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 133
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Concatenating text out of text manager (tttxt010)
Baan: ERP LN 6.1 FP7 (Infor ERP 10.1)
C/S: Client

Hello to All,
I’ve a problem with concatenating text.
I have a table tdsls100 (Sales Quotation) with 3 text fields (domain tctxtn = data typ “text”). These 3 fields I’d like to concatenate.

Code:
Extern domain tctext 	v1.text, v2.text, v3.text, v.all.text

V1.text = get.text(tdsls100.txt1.c)
v2.text = get.text(tdsls100.txt2.c)
v2.text = get.text(tdsls100.txt3.c)

v.all.text = trim$(v1.text) & trim$(v2.text) & trim$(v3.text)
The text out of these fields I’ve get with a function get.text()

Code:
Function string get.text(domain tctxtn itxtnr)
{
string buffer.line(1024)
buffer.line = “”
select tttxt010.*
from tttxt010
where tttxt010._index1 = {:i.txtnr}
selectdo
	buffer.line = buffer.line & tttxt010.text
endselect
return(buffer.line)
}
The combined text I will show in a report with the variable v.all.text (domain tctext).
When I’m running the report only the first part will be shown (here v1.text)
When I call the value during runtime with Message(v.all.text) there will shown the whole concatenated value.

So I’d have a look a the values in the debugger. Here I’ve found the text value shown as:

v.all.text = “v1.txt \r\n v2.text \r\n v2.text\r\n”

So I think the reason why in the normal report run the concatenated value will not shown in full length is the control sign \r\n.
Question 1: how can I delete these control signs \r\n during concatenating the text.
Question 2: domain tctext is a multibyte string. So how is the maximum length for this field type?
And how can I fill it with the full amount of 3 text files of type tctxtn?

Thanks in advance for reading this long thread ;-)

Best Regards
Bernd

Last edited by BaBernd : 29th June 2017 at 10:18. Reason: correction of the code example
Reply With Quote
  #2  
Old 29th June 2017, 10:44
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
You can use text.to.buf() instead of reading tttxt010 and assigning the value. Use the following code -

Code:
V1.text = get.text("tdsls100.txt1.c")
v2.text = get.text("tdsls100.txt2.c")
v2.text = get.text("tdsls100.txt3.c")
v.all.text = trim$(v1.text) & trim$(v2.text) & trim$(v3.text)


Code:
Function string get.text(string i.field(20))
{
     string final.text(1024)
     string btext(500)
     string bbuf(80,40)
     long b

     btext = ""

     for b = 1 to
           text.to.buf(trim$(i.field), language$, 2, bbuf) |# Use number of lines based on the requirement
           btext = trim$(btext) & " " & trim$(bbuf(1,b))
     endfor

     final.text = btext

     return(final.text)
}
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #3  
Old 29th June 2017, 14:10
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 133
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hi Bhushan,

thanks a lot. It' running fine.

An additional problem is:
I've defined the layout field in the report layout once as string and second as multibyte string domain (for the variable v.all.text). But only the number of signs will be shown as the layout field is declared.
Is there a sort of endless layout field available or how can I solve the problem to show all the text.

Best Regards
Bernd
Reply With Quote
  #4  
Old 29th June 2017, 14:38
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

You can use something like this -

v.all.text(1;50)
v.all.text(51;50)
v.all.text(101;50)
...

This will split your text into parts of 50 characters. Also, create a separate layout for each of them and in their print condition write-


not isspace(v.all.text(51;50))
not isspace(v.all.text(101;50))
...

So that, the layout will be skipped if the string is blank.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Sponsored Links
  #5  
Old 29th June 2017, 14:48
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 133
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Hi Bhushan,

very good idea!

I will check how I can implement it.
Thanks a lot and for fast reply.

Best Regards Bernd
Reply With Quote
  #6  
Old 11th July 2017, 08:16
BaBernd BaBernd is offline
Senior Member
 
Join Date: Mar 2015
Posts: 133
BaBernd is on a distinguished road
Baan: Infor 10.2.1 - DB: SQL-Server 2012 - OS: Windows Server 2008
Check done.
Solution works fine.

Thanks a lot!

Best Regards
Bernd
Reply With Quote
  #7  
Old 11th July 2017, 19:47
rahul ingale rahul ingale is offline
Member
 
Join Date: May 2011
Location: Hyderabad
Posts: 33
rahul ingale is on a distinguished road
Baan: baan infor - DB: sql - OS: windows xp
FYI.
TEXT_CONTENT macro can be used to get value in ln 10.5.
e.g

string text_data(999)
select TEXT_CONTENT(tccom100.text):text.data
from tccom100

Here all data linked text to get assigned to text.data.

cons:we have to give fixed size variable.
__________________
IRL
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Number from Text Manager mark_h Tools Development 10 17th January 2014 19:21
problem with text manager. mig28mx Tools Development 2 2nd October 2008 16:22
Text Manager Question ken bohnenkamp Tools Development 5 22nd August 2006 13:00
Text manager Kingsto88 Tools Development 1 27th September 2005 13:59


All times are GMT +2. The time now is 07:05.


©2001-2017 - Baanboard.com - Baanforums.com