Kingsto88
16th February 2005, 02:53
Dear Mark,

I tried your suggestion but it still does not work.


I am printing a customized report in Portrait.
I used spool.device = "P"
Then I want to print second report to the same printer
but in landscape.
so i changed spool.device = "L"

Both device data P and L are windows printer
I left device queue blank for both device, so it prints to the default printer.
For device P, paper type is A4
For device L, paper type is A4LS

But both are printing in portrait format.
Is there a workaround or solution to print second report in landscape?
Could you try it in your system and let me know your outcome.

Thanks and regards,

Hitesh Shah
16th February 2005, 15:01
There is a pre-defined variable spool.orientation . Check the default value in debug mode and set the same to correct value ("L" most probably) just before brp.open . It should get u the output in Landscape.

mark_h
16th February 2005, 15:46
Actual code from a session:


select tdilc402.runn, tdilc402.serb
from tdilc402
where tdilc402._index3 = {:in.emno}
and tdilc402.orno = :in.order
and tdilc402.pono = :in.line
order by tdilc402.serb desc
as set with 1 rows
selectdo
| No inbound - go generate it. Output is set to temporary file.
spool.device = "ASCIF"
spool.fileout = creat.tmp.file$(bse.tmp.dir$())
generate_inbound(in.emno,
in.reno,
in.order,
tdpur041.cwar,
errmsg)
if not isspace(errmsg) then
message(errmsg)
choice.again()
endif
endselect

| Fix inbound location.
check_inbound_location()
| Now print inbound. Here I ask the user for which spool.device to use
spool.device = ""
rpt = spool.open("rtdilc420301000",spool.device,2)
if not rpt then
choice.again()
endif
spool.close()
print_inbound(in.emno,
in.reno,
in.order,
tdpur041.cwar,
errmsg)
if not isspace(errmsg) then
message(errmsg)
choice.again()
endif


I do this type of thing in several places. In this example the users do like the generate inbound report so I send it to a file. I then ask the user what device they want to use to print inbound to - all of my printers are UNIX printers so I can not help with the windows printer stuff. Never really used it. I switch printers around using spool.device all of the time in my function servers so I know it should work. I have never used spool.orientation as Hitesh suggested.

It sounds like the function server code is working and the only thing that needs to be determined is why the "L" printer does not actually print in landscape mode. Not sure I can help there since I have never done anything with windows printers or the bwprint client.

Mark

Kingsto88
17th February 2005, 04:33
Thank you Mark and Hitesh,

I could not find variable spool.orientation but there is
spool.paper.type

I added spool.paper.type="A4LS" and it worked.

Thanks again.