Haggis
20th June 2002, 14:34
Hi
I have a session that prints two reports out to a printer, a success report and an error report for example, to the same printer. A user wants this changed so that he can pick his device for each report from the session itself and be able for the two prints to come out on different printers.
I know a couple of sessions where this happens but have no source to look at. Can anyone point me in the right direction?
Thanks
mark_h
20th June 2002, 16:03
Here is a sample from one of our programs - it is really designed to send 1 report to the printer and two files to disk.
#include "itccom0010" | Report handling
#include "itccom0007" | Rounding quantity
function domain tcbool open.reports.for.exports()
{
domain tcbool open.okay
open.okay = true
if prnt.rprt = tcyesno.yes then
if not open.report(1,spool.device,1,language$,1) then
mess("tcmcs00005",1,language$)
choice.again()
endif
endif
spool.device = "INTERFACE"
spool.fileout = strip$(shiftl$(file.path)) & "/BOM"
if not open.report(2,spool.device,1,language$,2) then
mess("tcmcs00005",1,language$)
open.okay = false
endif
spool.fileout = strip$(shiftl$(file.path)) & "/CST"
if not open.report(3,spool.device,1,language$,3) then
mess("tcmcs00005",1,language$)
open.okay = false
endif
return(open.okay)
}
The report data is sent using the print.record(1),print.record(2) or print.record(3) commands depending on which report gets the data.
Good Luck!
Mark
OmeLuuk
21st June 2002, 11:07
Check the open.report function in the tools manual. This function will trigger the ttstplopen where users can select the same or another device for the error report.
If you need a solution without programming effort in the Baan tools but some on OS level, you can choose to print to a file using a driver (printerdriver) and ttstpconv to write the output in ascii file, with a batch file to send the first doc (or part of the file) to one device and the second to the other...
Haggis
27th June 2002, 13:31
Thanks for the replies. I have now been able to getting round to looking at this problem again. I have checked my tools manual and have nothing about open.report Could someone send me some info on it? I am hoping to allow the user to select on the form the two devices he wishes to print the error report and success report to. I am guessing by using the open.report function I can pass it the inputted devices from the form.
OmeLuuk
27th June 2002, 13:42
Sorry,
The function mentioned is programmed in the include function tccom0010. If you do not have the include source itself, you can get it from me (tell me what appl. version). In Baan IVc4 it is only 282 lines.
Han Brinkman
27th June 2002, 15:22
use simply the brp.open/rprt_open statement twice? Once for the normal report and once for the error report.
If you don't want to hardcode the reports in your program script you can make use of different reportgroups via the reportgrp variable.
Regards,
Han
OmeLuuk
27th June 2002, 15:28
The report functions in the include are just sophisticated calls to enhance and ease the use of the standard 4GL functions Han is mentioning. Of course you can use the "bare functions" themselves too, see programmers manual - 4 GL functions Manual Pages section - under "R" functions rprt_open, rprt_send and rprt_close.
litrax
6th May 2009, 15:22
I know this thread is older, but I wondered why the function tccom0010 isn't ported to LN?
Or had my sharp eyes missed something... :confused:
Marioth
6th May 2009, 16:30
Look up the library tccomdll0010.
litrax
6th May 2009, 16:47
I could have guess this. :rolleyes:
Shure it is better that it was placed in an own dll...
Thank you