SGaudry
7th September 2001, 02:38
Dear Fellow Baan Developers,

I've have been trying to bring a text field into a layout from the text table tttxt010 through the tiitm001.txta field. I have the settings on the layout field

Link with Domain... No
Print Length... 30
Min/Max of Textlines... 0/1

This isn't bringing back anything for me at all. What I need is the first line (or first 30 characters)of text from this text file stored in the text table. The only way to view the text from the base baan sessions seems to be through the 'T' Text icon in session tdpuro992m000 which is the Lines session activated from session tdpuro991m000 (Maintain Purchase Requisition).

Any help - even if only ideas - is muchly appreciated,

Thanks you in advance,

S Gaudry,
Systems People

Neal Matthews
7th September 2001, 19:08
Hello,

Are you trying to pull in a field from the tiitm001 table into a layout that cannot see the table. Are there any other fields from tiitm001 in this part of the layout ? If so just try printing the item code again instead to check this.

If this is the problem then the usual way out of it is to write a very simple piece of SQL in the script using the item code from the requestion file but it must be in the correct layout.

eg. Get item text from purchase order line table (we don't use requistions)

detail.10:
before.layout:

select tiitm001.item,tiitm001.txta
from tiitm001
where tiitm001._index1 = {:tdpur041.item}
selectdo
mtext = tiitm001.txta
endselect

Then print field mtext.

Hope this is some use.

SGaudry
12th September 2001, 01:51
Well I tried that quite a while ago but had no luck then. I tried again with no result. I may be missing something though. I'm unable to edit report scripts (probably a simple setting on my local machine that isnt working). But I'm unsure if you would place this script in the report script or a session script.

It seems that even if I could display the tiitm001.txta through mtext, that it would simply give me the item text number and not the item text itself.

Thanks again for the help,

S. Gaudry

Han Brinkman
12th September 2001, 10:09
if you only need the first line of the text though it could contain more lines it's better to define a string field and read the first line into that.

So declare:
domain tcmcs.str30 firstline

Then in the detail section:
use the text.to.buf() function (look in the manual)

Use in the layout the field firstline with the domain tcmcs.str30.