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
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 17th May 2002, 16:57
olabas's Avatar
olabas olabas is offline
Junior Member
 
Join Date: Jan 2002
Location: Germany
Posts: 17
olabas is on a distinguished road
Baan: Baan IVc4 SP8 - DB: Informix - OS: HP-UX
Question printing different languages on one layout

I have to create a report printing labels.

To print just one layout in a couple of columns is the best way I know to do that in Baan.
But this single layout must conatain some textfields in different languages.
Of couse of different reasons I have just a textnumber not a real textfield of a table.

So here is my probleme:

Printing just one Layout makes using lattr.textlang$ to switch the language inpossible.

The <bic_text> - functions allways need a tablefield for accessing texts.

Does anybody has an idea how to print texts in differnt languages on one layout?
Reply With Quote
  #2  
Old 17th May 2002, 17:06
Han Brinkman's Avatar
Han Brinkman Han Brinkman is offline
Guru
 
Join Date: Aug 2001
Location: The Netherlands
Posts: 1,155
Han Brinkman has a spectacular aura aboutHan Brinkman has a spectacular aura about
Baan: All - DB: Oracle/ms-sql/db2 - OS: *nix/windows
Programming

Hi,

You could program it by using the text.to.buf() function, with this function you can read the text into a buffer.

Of course that would mean that you have to handle yourself the number of textlines that has to be printed.

M.fr.Gr.
Han
Reply With Quote
  #3  
Old 17th May 2002, 20:24
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,032
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Hi,

You might try this with coding -

Syntax

long text.present.in.language( long textnr, string lang [, ref long nr_lines ] )

Description
This tests whether a specified text is available in a specified language.
Arguments
textnr The text number of the relevant text.
lang The language for which you wish to test the availability of the text.
nr_lines This optional argument returns the number of lines the text occupies in the specified language.
Return values
1 (true) text available in specified language
0 (false) text not available in specified language
Context
3GL library function.

After you verify the text is present in the other language, try to read the text from another language.

long text.read ( string text_field(17), string lang,
ref string kw1(17) mb,ref string kw2(17) mb,ref string kw3(17) mb, ref string kw4(17) mb,ref string tgroup(8),ref string edit_opt(15), string tmp_file(256), long lock )

Description
This reads a specified text and stores it in a temporary file.
Arguments
text_field The name of the text field that must be read. See Text fields: overview. If the text number of the specified field is 0, a subprocess is started, which lists the texts associated with the current company and enables the user to select the text to be read.If no text is found, or if you abort the subprocess, text_field returns 0. Otherwise, it returns the text number of the retrieved text.
lang The language for which the text must be retrieved.
kw1 to kw4 These return the key words associated with the specified text.
tgroup This returns the name of the text group to which the text is assigned.
edit_opt This returns the default window type for the text.
tmp_file The name of the file in which the text must be stored. If this is an empty string, no text is retrieved and the function returns 0.
lock By default, a lock is applied to the text field when it is read. To read the field without lock, set this argument to 0.
Return values
>0 success; returns the number of lines read
0 no text found or subprocess aborted
-1 no permission
Context
3GL library function.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #4  
Old 19th May 2002, 23:39
olabas's Avatar
olabas olabas is offline
Junior Member
 
Join Date: Jan 2002
Location: Germany
Posts: 17
olabas is on a distinguished road
Baan: Baan IVc4 SP8 - DB: Informix - OS: HP-UX
The argument string text_field(17) is my major problem.
If I am right, text_field has to be the field of a database table.
But I have just the number of the text not the tablefield reffering the text. So I need a function like this:

long get.text( long text_nr, string lang, ref string return_text)

But I havend found anything like this in the online help of Baan.

Let me ask another way:
Is there any way to access a text in Baan just knowing the textnumber an not the tablefield reffering to this text?
Reply With Quote
  #5  
Old 20th May 2002, 20:36
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,032
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
I think this would work for Texts -

Code:
long	comp
|* company number - as texts as stored based on company no.
string	clan(1)
|* language code
string 	buffer.line(1024)

comp = 055
buffer.line = ""
clan = "2"

select 	tttxt010.*
from 	tttxt010
where 	tttxt010.ctxt = :txtno
and 	tttxt010.clan = :clan
|* or any of your language code
and 	tttxt010._compnr = :comp
order by tttxt010._index1
selectdo
     buffer.line = buffer.line & tttxt010.text
endselect

Just keep a check on the tttxt010.text field as its domain is of string 240 if you have long lines of text increase the buffer.line size so that you wont cross the array limits.

NOTE - This is for texts, for the RTF texts you have to refer to the other tools table tttxt015.

you can make it generic into a DLL and call with different parameters like -

long function get.text.lang(clan, txtno, comp, ref text)

Hope it helps you out.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao

Last edited by ~Vamsi : 9th June 2002 at 03:47.
Reply With Quote
  #6  
Old 21st May 2002, 09:57
Han Brinkman's Avatar
Han Brinkman Han Brinkman is offline
Guru
 
Join Date: Aug 2001
Location: The Netherlands
Posts: 1,155
Han Brinkman has a spectacular aura aboutHan Brinkman has a spectacular aura about
Baan: All - DB: Oracle/ms-sql/db2 - OS: *nix/windows
Try this

Why not assign the number to a text field, without actual storing it (db.write e.g.), and use the text functions after that?

Han
Reply With Quote
  #7  
Old 21st May 2002, 11:06
olabas's Avatar
olabas olabas is offline
Junior Member
 
Join Date: Jan 2002
Location: Germany
Posts: 17
olabas is on a distinguished road
Baan: Baan IVc4 SP8 - DB: Informix - OS: HP-UX
Hi

Your code works well.

Thank your very much.
Reply With Quote
  #8  
Old 21st May 2002, 11:46
olabas's Avatar
olabas olabas is offline
Junior Member
 
Join Date: Jan 2002
Location: Germany
Posts: 17
olabas is on a distinguished road
Baan: Baan IVc4 SP8 - DB: Informix - OS: HP-UX
To Han Brinkman

(Why not assign the number to a text field, without actual storing it (db.write e.g.))

That was also one idea I had. But I think that is the "dirty" way.
Also I was afraid of side effects.
Reply With Quote
  #9  
Old 21st May 2002, 15:27
Han Brinkman's Avatar
Han Brinkman Han Brinkman is offline
Guru
 
Join Date: Aug 2001
Location: The Netherlands
Posts: 1,155
Han Brinkman has a spectacular aura aboutHan Brinkman has a spectacular aura about
Baan: All - DB: Oracle/ms-sql/db2 - OS: *nix/windows
Dirty

Ain't reading the txt tables yourself also dirty?

You are assuming something that ain't documented.

In my way you only use a table field as a temp variable, I don't think that dirty.

However it's up to you, you have a working solution and that's what counts.

Kind regards,
Han
Reply With Quote
Sponsored Links
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
Report layout field printing karlovac Tools Development 4 2nd August 2002 17:24


All times are GMT +2. The time now is 23:22.


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