bigjack
24th November 2008, 12:17
Hi,

I've printing a text in my report. The text contains one variable whose value is populated at run-time, its working fine for small data. However if the value in the variable is longer , the expanded expression gets truncated.

i.e. for e.g my unexpanded text is "Customer Name : $custname" if custname contains small data like "abc123"" it works fine. However if it contains longer data like "aaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb" the expanded text gets truncated after some characters. i.e. printed matter is "Customer Name: aaaaaaaa"

Any idea how to rectify this thing.

Bye

bigjack
24th November 2008, 13:37
hey guys,

i managed to solve the problem. I increased the width of text field in report and it worked like a charm.

Bye

MilindV
25th November 2008, 05:51
Hi

Try using report script predefined variable 'lattr.textexpand'.
set this variable value to true in before program section.


lattr.textexpand R/W A boolean indicating whether or not variables included in text fields can be expanded. The default is false.


Regards
Milindv

NvpBaaN
30th November 2008, 11:27
lattr.textexpand is typically used for expanding "variables" in the text field...in this case, probably there are no variables so setting lattr.textexpand to TRUE might not have worked.

MilindV
1st December 2008, 05:39
Thanks NvpBaan

thanks for correcting me, but now i am confused:confused:, as i am not exactly understanding,
what is mean by "variable in text field". will u explain me with an example?
Because the text field which wil be displayed on report must be a variable itself.

Thanks and Regards
MilindV

sprasad
1st December 2008, 14:47
Hi

You can get this in the Baan help


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.