maheswar
27th January 2011, 15:10
Hi All,

This in an different post about afs only.

stpapi.put.field("tdakp9492m000","pono.f",str$(10))
stpapi.put.field("tdakp9492m000","pono.t",str$(16))

stpapi.set.report("tdakp9492m000","rtdakp949211000","W",err.msg)
if isspace(err.msg) then
stpapi.continue.process("tdakp9492m000",err.msg)
endif

hint:Here "W" (in stpapi.set.report function)is the device name of windows printer.

I am using this above code to print a report in windows printer.
but when i am executing my code this report is getting printed in windows printer directly and i am not able to see the preview.

But according to my requirement i must able to see the preview.
Please give me some solution.

Thanks & REgards,
Maheswar

mark_h
27th January 2011, 16:35
Use Spool.preview (http://www.baanboard.com/baanboard/showthread.php?t=30614&highlight=spool.preview).

maheswar
28th January 2011, 05:59
Hi Sir,

Thank you for suggestion.

I have used this variable in my script.
but it is not giving any preview.


Regards,
Mahes

mark_h
28th January 2011, 15:50
Can you post the code and a screen shot of the device you are using? Do you own the source code for that session(tdakp9492m000)? Can you put it in debug mode and see what spool.preview is equal too when the report gets launched? At one point in time (and I think I still do this) I had to export spool.copies and import it into a session to change the number of copies.

maheswar
28th January 2011, 16:17
Hello Sir,


I have tested in debug mode. this spool.preview is getting assigned , but no change in output.

I am posting screen shot of device and script also.
Please check it.

with
Thanks & Regards,
Mahes

mark_h
28th January 2011, 18:17
Did you see that last post by jmartin? Move where spool.preview is set.


function print.standard.report()
{
string err.msg(80)
message("hello")
spool.preview= true
stpapi.put.field("tdakp9492m000","orno.f",str$(10))
stpapi.put.field("tdakp9492m000","orno.t",str$(16))

stpapi.put.field("tdakp9492m000","pono.f",str$(10))
stpapi.put.field("tdakp9492m000","pono.t",str$(16))
stpapi.set.report("tdakp9492m000","rtdakp949211000","W",err.msg)
|spool.preview= 1

if isspace(err.msg) then
stpapi.continue.process("tdakp9492m000",err.msg)
endif


}


I tested my code in that other thread and it no longer worked. I had to move the spool.preview to before I called any stpapi code.

maheswar
29th January 2011, 05:46
Hello Sir,


Thank you for your valuable suggestions.

I placed "spool.preview=1 " before any afs is called.

so it is working fine.

With
Thanks & Regards,
Mahes