pralash
5th March 2018, 09:20
Hi,
By default, I already know about that a report is printed only one time depends upon the device and copies those are provided by the user... But now I need to print a particular report "n" times as per the requirement of the user... In order to perform this task, I have implemented a session with form fields for getting the spool device, no.of.copies to be printed from the user as shown in the following attachment...
Whenever i'm giving the input filed (number of copies) as 2 or 3 for , the report is printed only one time.... So how can i assign the form filed value(no.of.copies) to the default field "copies" in the device select window as shown in the attachement....
Can anybody please assist how to perform this task....
Thanks in Advance,
Regards,
Pralash
bdittmar
5th March 2018, 09:52
Hello,
use brp functions !
Regards
pralash
5th March 2018, 11:00
Hello,
I'm using the pre defined variable "spool.pr.copies" in order to display a particular report "n" times depends upon the user requirement... But still it is print the report only one time....
When I debugging my script, the variable "spool.pr.copies" holds a new value which one is given by the user in run time... But exactly I don't know why the report is not printed for "n" times... My script is as follows....
field.print.copy:
when.field.changes:
message("hi")
spool.pr.copies = print.copy
Here "print.copy" is a one of the form field which hold a value( that is number of times the report to be printed)...
Whenever the "when.field.changes" is triggerd, the "spool.pr.copies" hold the new value which one is supplied by the user.... But the report is printed for only one time.... Hence can you please assist me that how to print the report more than one times please....
Thanks in Advance...
Regards,
Pralash
bdittmar
5th March 2018, 12:35
Hello,
use brp funcionality
brp.open , brp.ready , brp.close
Not: rprt_send()
Regards
pralash
5th March 2018, 12:53
Hi,
I'm already used all brp function as you mentioned in my UI script... My programming script is as follows.
|******************************************************************************
|* whesc3403m000 VRC B61C 9 esc
|* Escatec - Print Large WH Label
|* Installation User
|* 02-26-18 [10:19]
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttcibd001 |* Item Data
table twhinh210 |* Inbound Order Lines
table twhinh312 |* Receipt lines
table twhltc100 |* Item Lot
table tttaad300 |* Tools
table tttaad306 | Device preferences
extern domain tcitem zoom.item |* Item name for Zoom
extern domain tcclot zoom.clot
extern domain tcmcs.str14 device
extern domain tcmcs.str20 pallet
extern domain tcmcs.long print.copy
long brp.id, i
|long spool.pr.copies
extern domain tccomp emid.f | Data Sending to the report - start value
extern domain tccomp emid.t | Data Sending to the report - final value
#include <bic_dam> |* DAM Support
#include "itcmcs2000" |* Dal-GUI Support
|****************************** program section ********************************
before.program:
|****************************** group section **********************************
group.1:
init.group:
get.screen.defaults()
|********************************form section***********************
form.1:
init.form:
|device = toupper$(device)
|****************************** choice section ********************************
choice.cont.process:
on.choice:
execute(print.data)
choice.print.data:
on.choice:
| if rprt_open() then
| read.main.table()
| rprt_close()
| else
| choice.again()
| endif
if isspace(device) then
brp.id = brp.open(spool.report, "", 1)
else
brp.id = brp.open(spool.report, device, 0)
endif
if brp.id > 0 then
read.main.table()
brp.close(brp.id)
else
choice.again()
endif
|**** Field Section ***********************************************************
|field.emid.f:
|when.field.changes:
| emid.t = emid.f
field.whinh312.item:
on.input:
if isspace(whinh312.item) then
message("Enter a value for the Item field")
input.again()
endif
check.input:
select tcibd001.*
from tcibd001
where tcibd001.item = :whinh312.item
selectdo
selectempty
| set.input.error("tctccom0003",1)
set.input.error("tcibddll02063",1)
endselect
|after.display:
| if isspace(whinh312.item) then
| message("must")
| to.field(whinh312.item)
| endif
field.whinh312.clot:
|before.input:
| attr.dorp = 1
check.input:
select whltc100.*
from whltc100
where whltc100. clot = :whinh312.clot
selectdo
selectempty
set.input.error("tctccom0002",1)
endselect
when.field.changes:
select whltc100.*
from whltc100
where whltc100.item = :whinh312.item and whltc100.clot = :whinh312.clot
selectdo
whinh312.sfbp = whltc100.bfbp
whinh312.ltbp = whltc100.ltbp
selectempty
whinh312.sfbp = ""
whinh312.ltbp = ""
endselect
display(whinh312.sfbp)
display(whinh312.ltbp)
selection.filter:
query.extend.where.in.zoom("whltc100.item = " & quoted.string(whinh312.item))
field.device:
before.checks:
device = toupper$(device)
check.input:
if not isspace(device) then
select ttaad300.*
from ttaad300
where ttaad300.devc = :device and ttaad300._compnr = 0
selectdo
|device = toupper$(device)
|display("device")
selectempty
set.input.error("tctccom0003",1)
endselect
endif
field.print.copy:
when.field.changes:
message("hi")
spool.pr.copies = print.copy
|**** Form Section ************************************************************
|**** Zoom Section ************************************************************
zoom.from.all:
on.entry:
import("zoom.item", zoom.item)
import("zoom.clot", zoom.clot)
if not isspace( zoom.item) then
whinh312.item = zoom.item
endif
if not isspace( zoom.clot) then
whinh312.clot= zoom.clot
endif
|****************************** function section ******************************
functions:
function read.main.table()
{
| long spooler
|select tccom151.*
|from tccom151
|where tccom151._index1 inrange {:emid.f}
| and {:emid.t}
|order by tccom151._index1
|selectdo
| rprt_send()
|endselect
select whltc100.*
from whltc100
where whltc100.item = :whinh312.item and whltc100.clot = :whinh312.clot
selectdo
|spooler = spool.open("rwhesc340301000","D",0)
|spooler = spool.open("","D",0)
|rprt_send()
|spool.pr.copies = print.copy
|ttaad306.ncop = spool.pr.copies
|for i = 1 to print.copy
brp.ready(brp.id)
|endfor
endselect
}
Can you please guide me that where can I change the script.... Already I used the spool.pr.copies in the when.field.changes.....
Regards,
Pralash
mark_h
5th March 2018, 14:56
I would try it before the brp.open and then check it after it.
mark_h
5th March 2018, 15:14
I actually do this is one session where I write the output to a file.
if (rprt_open()) then
if spool.report = "rtibom941604000" then
| First save off tag printer information user entered
tag.printer = spool.device
tag.copies = spool.pr.copies
rprt_close(2)
| Create temporary file to copy the PC file to
temp.file = creat.tmp.file$(bse.tmp.dir$())
temp.file = strip$(temp.file)
spool.fileout = temp.file
spool.report = "rtibom941604000"
spool.device = "INTERFACE"
spool.pr.copies = 1
rprt.id = spool.open("rtibom941604000",spool.device,0) | Open spooler in script
if not rprt.id then
spool.close()
choice.again()
endif
rprt_open()
endif
find.requirements()
rprt_close()
pralash
6th March 2018, 07:04
Hi,
I go through the sample script.... But I'm unable to print the report for "n" times...
Hence can you please assist me that where I need to change in my script for print the report more than one times by using spool.pr.pages...
Regards,
Pralash
mark_h
6th March 2018, 14:25
The code I posted would go in the choice.print.data, on.choice section:
spool.report = "rtibom941604000"
spool.device = "INTERFACE" | put the print device you want
spool.pr.copies = 1 |<--put the number of copies you want
rprt.id = spool.open("rtibom941604000",spool.device,0) | change the report to the one you want.
if not rprt.id then
spool.close()
choice.again()
endif
rprt_open()
bhushanchanda
7th March 2018, 13:57
Yes, as Mark suggested, since its a spooler variable, try spool.* functions instead of brp.* and see if works.
pralash
7th March 2018, 15:55
Hi Bhushan,
Thanks so much for your guidance.... As you told, I'll try spool.* functions instead of brp.* functions....
Regards,
Pralash
pralash
8th March 2018, 13:56
Hi Bhushan & Mark,
Thanks so much for your information....
Please let me know that what is the equal spool function for "brp.ready()" function....
Regards,
Pralash
mark_h
8th March 2018, 14:55
You can use a combination of brp to open the report and spool.open to set the device paramaters. In my example I basically close the report, change the printer, re-open the report. If you read rprt_open basically opens the report and the device - just like brp.open. Basically if the session has multiple reports let them pick the report and the device. Then close the report. Then I believe you do spool.open to open the spool with number of copies, then brp open the report - you do these both without prompting the user for more input. Run the report, close report and close the spooler.
pralash
8th March 2018, 15:52
Hi Bhushan & Mark,
As you suggested, I have used the spool.* function instead of brp.* function. But i'm not able to print the report for "n" times.... Can you please go through my script... and also assist me that where can I have a error in my script... My script is as follows....
|******************************************************************************
|* whesc3403m000 VRC B61C 9 esc
|* Installation User
|* 02-26-18 [10:19]
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttcibd001 |* Item Data
table twhinh210 |* Inbound Order Lines
table twhinh312 |* Receipt lines
table twhltc100 |* Item Lot
table tttaad300 |* Tools
table tttaad306 | Device preferences
extern domain tcitem zoom.item |* Item name for Zoom
extern domain tcclot zoom.clot
extern domain tcmcs.str14 device
extern domain tcmcs.str20 pallet
extern domain tcmcs.long print.copy
|long spool.id
extern domain tccomp emid.f | Data Sending to the report - start value
extern domain tccomp emid.t | Data Sending to the report - final value
#include <bic_dam> |* DAM Support
#include "itcmcs2000" |* Dal-GUI Support
|****************************** program section ********************************
before.program:
|****************************** group section **********************************
group.1:
init.group:
get.screen.defaults()
|********************************form section***********************
form.1:
init.form:
|****************************** choice section ********************************
choice.cont.process:
on.choice:
execute(print.data)
choice.print.data:
on.choice:
if isspace(device) then
spool.id = spool.open(spool.report, "", 1)
else
spool.id = spool.open(spool.report, device, 0)
endif
if spool.id > 0 then
read.main.table()
rprt_close()
spool.close()
else
choice.again()
endif
|if not spool.id then
| spool.close()
| choice.again()
|endif
|rprt_open()
|read.main.table()
|rprt_close()
|**** Field Section ***********************************************************
field.whinh312.item:
on.input:
if isspace(whinh312.item) then
message("Enter a value for the Item field")
input.again()
endif
check.input:
select tcibd001.*
from tcibd001
where tcibd001.item = :whinh312.item
selectdo
selectempty
set.input.error("tcibddll02063",1)
endselect
field.whinh312.clot:
check.input:
select whltc100.*
from whltc100
where whltc100. clot = :whinh312.clot
selectdo
selectempty
set.input.error("tctccom0002",1)
endselect
when.field.changes:
select whltc100.*
from whltc100
where whltc100.item = :whinh312.item and whltc100.clot = :whinh312.clot
selectdo
whinh312.sfbp = whltc100.bfbp
whinh312.ltbp = whltc100.ltbp
selectempty
whinh312.sfbp = ""
whinh312.ltbp = ""
endselect
display(whinh312.sfbp)
display(whinh312.ltbp)
selection.filter:
query.extend.where.in.zoom("whltc100.item = " & quoted.string(whinh312.item))
field.device:
before.checks:
device = toupper$(device)
check.input:
if not isspace(device) then
select ttaad300.*
from ttaad300
where ttaad300.devc = :device and ttaad300._compnr = 0
selectdo
selectempty
set.input.error("tctccom0003",1)
endselect
endif
field.print.copy:
when.field.changes:
spool.pr.copies = print.copy
|**** Form Section ************************************************************
|**** Zoom Section ************************************************************
zoom.from.all:
on.entry:
import("zoom.item", zoom.item)
import("zoom.clot", zoom.clot)
if not isspace( zoom.item) then
whinh312.item = zoom.item
endif
if not isspace( zoom.clot) then
whinh312.clot= zoom.clot
endif
|****************************** function section ******************************
functions:
function read.main.table()
{
select whltc100.*
from whltc100
where whltc100.item = :whinh312.item and whltc100.clot = :whinh312.clot
selectdo
rprt_send()
endselect
}
Please find the screen shot of Form editor and Report dialogue box as an attachment...
I'm so sorry to asking to fix the issue repeatedly.... Expecting the changes in my script...
Regards,
Pralash