Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
How big is your Baan-DB (just Data AND Indexes)
0 - 200 GB
14%
200 - 500 GB
32%
500 - 800 GB
4%
800 - 1200 GB
4%
1200 - 1500 GB
11%
1500 - 2000 GB
14%
> 2000 GB
21%
Total votes: 28

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 26th July 2002, 11:26
lli-baan's Avatar
lli-baan lli-baan is offline
Member
 
Join Date: Apr 2002
Location: Germany
Posts: 98
lli-baan is on a distinguished road
Baan: BaanIVc4 - DB: Informix - OS: Unix
Expanding Text variables

Hi folks

I found this in Baan Help but I need an example. Can anybody help me???

I want to crate a text with a variable. The variable I set in a reportscript.

--------------------------------------------------------------
Variables or expressions that are included in text lines can be expanded or substituted for report purposes. You must set the variable lattr.textexpand=TRUE if you want this to happen. Expressions are internally evaluated by the function expr.compile().

Customers can use variables in texts. For example, "address", "city", "salary" and so on. Customers must be informed about these variables so that they can use them.

Syntax

The following is the syntax for variables and expressions included in text lines:

$variable or #variable

${expression} or #{expression}

When the $ symbol if used, the text moves over to accommodate the expanded variable or expression. When the # symbol is used, the expanded variable or expression overwrites existing text.

Example

The following is an example of text created by using the text manager. The text includes both variables and expressions that can be expanded/substituted for report purposes.

To: $surname $christian name #date , Ede
$address

$ZIP code $city
Dear $christian name:

We have the pleasure of informing you that, as of $date, your salary
has been raised by 5%. For you this implies a gross amount of
${edit( salary + ( salary * 0.05 ), "ZZZZ9,ZZ" )} per month.
Kind regards, $Mgr.

© 1998 Baan Development B.V. All rights reserved

-------------------------------------------------------------------------------
Reply With Quote
  #2  
Old 26th July 2002, 15:03
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,135
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Test...

All I did to get this to work was to set lattr.textexpand to true in the report script.

Code:
field.tdpur040.txta:
before.print:
	lattr.textexpand = true
	validate.textline()

Then in the purchase order text I could use $tdpur040.orno. So for example I put in the text $tdpur040.orno is long lead material. This allows you to use the report variables in the text.

Hope this helps!

Mark
Reply With Quote
  #3  
Old 27th January 2005, 20:57
rmarles's Avatar
rmarles rmarles is offline
Senior Member
 
Join Date: Sep 2003
Location: London, Ontario
Posts: 112
rmarles is on a distinguished road
Baan: 4c4 sp20 - DB: oracle 10g - OS: hpux 11i
predefined variables

Mark -

Do you have a list of predefined variables that can be expanded upon?
IE (from financial statements

$cdat (current date)
$ctim (current time)
$cmpn (company name)
$stds (statement design)

Thanks
Reply With Quote
  #4  
Old 27th January 2005, 21:28
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,135
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Pre-defined Variables

Not sure if I understand - here are the links to predefined variables on the wiki, one for report and one for scripts.

The ones you mentioned I am not familiar with. Are these associated with something specific? You can always run a script in debug mode and use the "L" command to see what all is defined.

Mark
Reply With Quote
  #5  
Old 27th January 2005, 21:32
rmarles's Avatar
rmarles rmarles is offline
Senior Member
 
Join Date: Sep 2003
Location: London, Ontario
Posts: 112
rmarles is on a distinguished road
Baan: 4c4 sp20 - DB: oracle 10g - OS: hpux 11i
Mark

Thanks for the attempt - I have read both those help texts before. Unfortunately they don't really help.

I'm looking for system variables that the system could expand in a report.
For example, the date, the company name, etc.

I looked at one of our financial statments and the header text has the variables mentioned previously attached to them. By printing a statement, I was able to determine what they expanded to.

$cdat (current date)
$ctim (current time)
$cmpn (company name)
$stds (statement design)

I was hoping there were other variables similar.

Thanks!
Reply With Quote
  #6  
Old 27th January 2005, 22:49
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,135
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I am not sure these are documented. I searched the wiki and a couple of other places with no success. I do know some of the include files does set some variables and I have never seen documentation on them.

Mark
Reply With Quote
  #7  
Old 27th January 2005, 23:35
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Those variables are available in the Financial Statements because they are declared as external in the Program Script.

Code:
	|declarations for text manager
	extern	domain	tffst.layt	layt
	extern	domain	tffst.ltds	ltds
	extern	domain	tffst.stmt	stmt
	extern	domain	tffst.stds	stds
	extern	domain	tcncmp		comp
	extern	domain	tffst.desc	cmpn
	extern	domain	tffst.desc	cdat
	extern	domain	tffst.desc	ctim
	extern	domain	tfgld.user	user
	extern	domain	tffst.desc	usnm
	extern	domain	tffst.accn	accn
	extern	domain	tffst.acds	acds
	extern	domain	tffst.subl	subl

So, it depends on your calling program. If you declare them as external, or have them in your report script and declared on your Report Input Fields, then you should be able to reference them in the text as $variablename in the text. In theory, anyway, sorry, I have never actually tried.
Reply With Quote
Sponsored Links
  #8  
Old 18th October 2012, 12:22
sudheer sudheer is offline
Newbie
 
Join Date: Oct 2012
Posts: 1
sudheer is on a distinguished road
Baan: BaanIV - DB: sql - OS: windows 98
hii mark. . .how would i expand a variable inside the layout
get me the initial declarations to be and also tell me where to use lattr.textexpand and lattr.prline inside program sections.

thanks
Reply With Quote
  #9  
Old 18th October 2012, 15:51
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,135
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Your going to have to play with it, we never really used it. But if I recall correctly if you set lattr.textexpand to true - then inside a layout you could use $reportvariable anywhere. I am not sure it matters where you put lattr.textexpand - you can follow the links above to get to the programmers manual and I believe there is an example also.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #10  
Old 19th October 2012, 17:30
shah_bs's Avatar
shah_bs shah_bs is offline
Guru
 
Join Date: Jan 2002
Location: Lewisville, Texas
Posts: 390
shah_bs is on a distinguished road
Baan: BAAN IVc3 with A&D2.2b - DB: ORACLE 9 - OS: HPUX
As Mark mentioned, the lattr.expand = TRUE needs to be placed in the before.program section of the REPORT Script, only once.

Then, the text field needs to be 'painted' in the report layout - for example, in a Sales Invoice, you could have tdsls040.txta in the report layout.

Then, in the TEXT matter of the text of any particular sales order where the variable to be expanded, you would create the text as follows: for example, for printing in a Sales Invoice, you could have text like follow:

Code:
These commodities are authorized by the U.S. Government for 
export only to ${strip(tcmcs010.dsca)} for use 
by ${strip(tccom010.nama)}.
It is assumed that tcmcs010.dsca and tccom010.nama have been read in the PROGRAM script.

Instead of table variables, it is possible to use program variables - obviously, these have to be defined as extern in the PROGRAM script, and included in the field list of the report layout.

Hope this helps.

Last edited by shah_bs : 19th October 2012 at 18:30.
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
Appending extra text at start of each text line on report aardvark Tools Development 2 23rd June 2004 16:01
No read authorization for text group text aihbikers Tools Development 2 31st October 2003 16:26
CODE: VB Calling a DLL gfasbender Code & Utilities 0 13th March 2002 17:42


All times are GMT +2. The time now is 17:36.


©2001-2018 - Baanboard.com - Baanforums.com