justone
23rd February 2004, 12:50
I'm working on a session, which runs standard script (ticpr2401 Print Cost Price by Item), but it has customized report. I 'd like to add one more field to the session, since I have to update custom table with results of report data. I tried to put it on session form, but it is not passed to report (probably because it is not declared in session script, which I can't do). Is it possible to generate input window from report script (something like message window)??

Any help is appreciated.

Hitesh Shah
23rd February 2004, 13:16
There are functions like data.input appear to be useful in such conditions . But it works only in ASCII and not in GUI .

As u said u dont have the access to standard script , the only thing u can do probably is create a 3gl / gl program which accepts inputs and passes the value to the report . Such new program has to be called only once in the report and ideal place to call this session could be in before.report section. Export the value from this program to the report.

I'll agree this is very lengthy process .

JaapJD
23rd February 2004, 13:37
You can add variable free$ on the session form and use it in the report. If you need more, you can also use procesinfo$.

Hitesh Shah
23rd February 2004, 13:55
Jaap's solutions is very quick,effective and better than the lenghty solution envisaged by me. U should use that only.

justone
23rd February 2004, 14:53
Originally posted by JaapJD
You can add variable free$ on the session form and use it in the report. If you need more, you can also use procesinfo$.

I tried to use free$ on session form, but I don't know how declare it. My data type domain should be tcorno, but it seems that free$ is already declared. If I try to remove domain and use only data type I get a strange error (see attachment).

Is it possible to use free$ in a script like this:

select tipmk100.*
from tipmk100
where tipmk100._index1={:free$}
selectdo

JaapJD
23rd February 2004, 15:02
free$ is string(50), but you can use any string domain on the form.

To use it in a query:


orno = lval(free$(1;6))
..
where tipmk100.orno = :orno

Hitesh Shah
23rd February 2004, 15:02
free$ and procesinfo$ are string variables of length 50/200 respectively.

U need to convert the string to long using val/lval functions and then use in the report script.

justone
23rd February 2004, 15:11
Thanks a lot for help, it's working fine, all ineed is to clear free$, can I simply write free$="", or is there a better way to clear value from it?

JaapJD
23rd February 2004, 15:40
free$="" is OK.

fmorais
27th February 2004, 14:47
Hi.

I did not know this possibility. This is great.
However, I tested it and the variable free$ never gets reset...

I tried a free$="" in an after.report section and still no luck.

If you have to put it in the session script, you get the same problem as before...you have to customize the session.

Thanks
Fred

JaapJD
27th February 2004, 15:05
The following code in the report script will help a little bit:


after.program:
free$ = ""
export("free$", free$)


But then the contents of free$ are gone if you press the print button the second time.

Better is to use procesinfo$. This variable is reset each time you start a session. You can use substrings (e.g. procesinfo$(1;6), procesinfo(7;6), etc). On the form you specify always procesinfo$ and you use the Startpos Str. field to specify the offset.

fmorais
28th February 2004, 21:09
I will try the suggestion.
Thanks a lot

Fred