Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
36%
Installation Wizard into new VRC
36%
Manual into existing VRC
7%
Manual into new VRC
20%
Total votes: 44

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 5th March 2018, 08:20
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Print report multiple times as per user requirement
Baan: Other/Unknown
C/S: None/Unknown

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
Attached Images
File Type: png no.of.copy.PNG (33.0 KB, 14 views)
Reply With Quote
  #2  
Old 5th March 2018, 08:52
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,698
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Use brp functionality

Hello,
use brp functions !

Regards
__________________
//Bernd
Reply With Quote
  #3  
Old 5th March 2018, 10:00
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
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
Reply With Quote
  #4  
Old 5th March 2018, 11:35
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,698
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
Thumbs up Not working on rprt_send()

Hello,

use brp funcionality

brp.open , brp.ready , brp.close

Not: rprt_send()

Regards
__________________
//Bernd
Reply With Quote
  #5  
Old 5th March 2018, 11:53
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
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
Reply With Quote
  #6  
Old 5th March 2018, 13:56
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,058
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I would try it before the brp.open and then check it after it.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 5th March 2018, 14:14
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,058
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I actually do this is one session where I write the output to a file.
Code:
	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()
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #8  
Old 6th March 2018, 06:04
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
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
Reply With Quote
  #9  
Old 6th March 2018, 13:25
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,058
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
The code I posted would go in the choice.print.data, on.choice section:
Code:
			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()
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #10  
Old 7th March 2018, 12:57
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,352
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Yes, as Mark suggested, since its a spooler variable, try spool.* functions instead of brp.* and see if works.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #11  
Old 7th March 2018, 14:55
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
Hi Bhushan,

Thanks so much for your guidance.... As you told, I'll try spool.* functions instead of brp.* functions....

Regards,
Pralash
Reply With Quote
  #12  
Old 8th March 2018, 12:56
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
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
Reply With Quote
Sponsored Links
  #13  
Old 8th March 2018, 13:55
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,058
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
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.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #14  
Old 8th March 2018, 14:52
pralash pralash is offline
Senior Member
 
Join Date: Feb 2017
Posts: 208
pralash is on a distinguished road
Baan: 9.0 - DB: SQL Server - OS: Windows 2012R2
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
Attached Images
File Type: png screen1.PNG (14.5 KB, 5 views)
File Type: png screen2.PNG (8.3 KB, 4 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple report copies from Report script a.menon Tools Development 11 25th February 2014 13:29
Report print Virender Tools Development 2 19th December 2009 01:14
Session not print the selected linked report nasheer Tools Development 2 21st February 2008 06:15
Howto call report n no of times juvenile Tools Development 3 7th September 2004 07:00


All times are GMT +2. The time now is 19:14.


©2001-2017 - Baanboard.com - Baanforums.com