rathodne
9th February 2011, 08:27
I have text number and i want to print the text in the text number on the report.
so that I am using the text.read function to read the text and store it in the temporary file and after that read the temporary file character by character to print on the report.
But while using text.read function the session "display text"
get zoomed out to select the text number.
So, please suggest me a solution to read the text from the text number without zooming the session "disply text" or any other session.

amitmmokashi
9th February 2011, 08:40
Hi,
To read text from a text field, you can use the function "text.to.buf". It reads text from the specified text field and stores into the text buffer.


Syntax
long text.to.buf( string text_field(17), string lang, long nr_lines, ref string buf(,) [, long rtf.text] )

Description
This stores the text of a specified text field in a two-dimensional string array.

Arguments
text_field
The name of the text field that must be retrieved. See Text fields: overview.

lang
This specifies the relevant language.

nr_lines
This specifies the maximum number of lines that can be stored in the buffer.

buf
This specifies the buffer in which the text must be stored.

rtf.text
Set this argument to true if you want the text to be stored in RTF format instead of ASCII format. This is possible only when using a text group that supports RTF data.


Return values
>0 number of stored lines
0 error
- 1 no permission to store the text




Regards,
Amit Mokashi

rathodne
9th February 2011, 15:58
Hi,
I am trying to use text.to.buf function but i am not able to use two dimentional array.
Please explain how to use two dimentional array for text.to.buf function.

bdittmar
9th February 2011, 17:11
I have text number and i want to print the text in the text number on the report.
so that I am using the text.read function to read the text and store it in the temporary file and after that read the temporary file character by character to print on the report.
But while using text.read function the session "display text"
get zoomed out to select the text number.
So, please suggest me a solution to read the text from the text number without zooming the session "disply text" or any other session.

Hello,

You're on B4, Right ?

If your textnumber is stored in tablefield like "tiitm001.txta" (itemtext).
Define a report inputfield for field tiitm001.txta (where your textnumber is stored)

Add this field to your reportlayoutsection with domain tctxtn.
Standard width of textline will be 80 characters (if neccessary modify)

That's all, your text (if available) should be printed on report.

Regards

tomlbacon
16th February 2011, 19:58
the following code is used to print Purchase Order Line text

string tmp.file(80)
string tmp.line1(80)
long no.lines
long ret.io
long file.io
long countr , iterator

line = 0 | line item text

if tdpur401.txta <> 0 then
tmp.file = "text.temp"
no.lines = text.read("tdpur401.txta","2",attr.textkw1$,
attr.textkw2$,attr.textkw3$,attr.textkw4$,
attr.textopt$,attr.textopt$,tmp.file,0)
countr = 0
file.io = seq.open(tmp.file,"r")
if file.io <> 0 then
ret.io = seq.gets(tmp.line1,80,file.io)
while ret.io = 0
if tmp.line1(1;1) <> "<" then
txtn.line = tmp.line1(1;80)
countr = countr + 1
print.report()
endif
txtn.line = ""
ret.io = seq.gets(tmp.line1,80,file.io)
endwhile
endif
endif

file.io = seq.close(file.io)