jmartin
30th January 2007, 15:32
Hi, all:

I was wondering how to set the "preview" variable when executing any report by AFS.

The standard afs function is, in example

stpapi.set.report("<session>", "<report code>", "<device>", error)

having no room for that "preview" variable (assuming tgyenox.yes as valid value)

Any idea?

mark_h
30th January 2007, 16:09
I did a bic_info6.1 on ottstpsplopen - I saw a spool.preview variable as a long. I do not know if you can set this to 1 before opening the report and have it work. It might take some playing around to get it correct - I know in one case I had to import spool.pr.copies into one of the sessions to get it to accept the number of copies. I do not know if that is the case here or even if the spool.preview variable works.

mark_h
30th January 2007, 16:41
Okay - it works, but I had to set it before the first call to the report session.

function testpr2()
{
spool.device = "LOUIR01_95"
spool.preview = true
| spool.preview = false
stpapi.put.field("tuudi0420m000","user.f","andersbj")
stpapi.put.field("tuudi0420m000","user.t","andersgl")
stpapi.set.report("tuudi0420m000","rtuudi042011000",spool.device,err)
stpapi.continue.process("tuudi0420m000",err)
stpapi.end.session("tuudi0420m000")

}

jmartin
30th January 2007, 17:26
Hi:

Thanks a lot. Your suggestion works allright. I thought that having no "instance" of the ottpstplopen there was no way of sending spool. variables.

BTW, in my case, I have set the variable just before sending the continue command, and it works...
stpapi.put.field("tdsls4402m000", "crte.t", "zzzzz")
stpapi.put.field("tdsls4402m000", "prnt.shortage", str$(etol(tcyesno.yes)))

stpapi.set.report("tdsls4402m000", "rtdsls4402010t1", device, error)

spool.preview= 1

stpapi.continue.process("tdsls4402m000", error)

mark_h
30th January 2007, 19:26
Interesting - because that would not work for the report I was testing, then again I set the spool.preview right before the stpapi.report. Let me go try the format you have.

mark_h
30th January 2007, 19:30
I must be losing it - I know I tried this:

spool.preview = true
stpapi.set.report("tuudi0420m000","rtuudi042011000",spool.device,err)

The first go around did not work, but know it does work. I know I compiled it, and ran it. Maybe I made another mistake - oh well, at least it works.

jmartin
4th August 2009, 11:37
Hi, all:
After one porting set update and some Toolsa patches (Baan IV C4, SP 18 Tools) it worked only placing the spool.preview =1 (or true, acts the same) before the first AFS call of the printing session.

Placing the command just close to the stpapi.set.report, or sptapi.print.report just doesn't work as before!


Cheers!