ken bohnenkamp
26th February 2009, 21:01
Is there a way to set up a baan print device so that when a user runs a report and chooses this device, the report will go out as deferred and will not print until some action is taken by a user or administration to start the deferred report printing. And if not through the print device is there any other way to do something like this? Any help would be appreciated.:confused:

toolswizard
27th February 2009, 19:34
Have you looked at Jobs?

ken bohnenkamp
27th February 2009, 20:29
Not sure what you mean, My report session does currently run in a job. What I want to do when the job finishes is create the report in a deferred status so that it doesn't print to the device until some type of interaction from someone in administration or a superuser.

_Ralph_
27th February 2009, 20:45
I guess this is possible only with a third part control as work-flow

blanchap
5th March 2009, 22:21
It depends also on when you want it to stop, after the print job?
tell me, why do you want it to stop until an interaction?

PB.

ken bohnenkamp
5th March 2009, 22:43
A user comes in at 7:00 am in the morning. This user would start the print process because we are printing our customer statements. The printer has a tendancy to Jam when printing statements and we want to make sure someone is here to monitor the printer while the statements are printing. The job I would set up to run and finish well before 7:00 am so it would be sitting there in a deferred mode until the user gets here and starts it printing. I have other processes that will print to this printer, so putting it off line until the user gets here in the morning is not an option.

norwim
5th March 2009, 23:05
Hi there,

I can think of several options to achieve this "delayed printig".
a) Define a printer that actually is a shell script which saves the print output to a file, then sleeps for some time until finally sending the saved output to the printer after waking up.
b) Define a pseudo printer, set the delete delay time of the user to 24 hours so that he can reprint the output when someone is there to watch the printer.
... b) leads to the question why the report isn't started later anyway :-)
c) I would bet heavy on it that your spooling system supports some kind of job control with printer groups and time schedules - this kind of print queue management was usual in the old days :-)

hth

Norbert

blanchap
5th March 2009, 23:19
Hi,

You could also send the document by email to the user (using mailx in Unix). then the user prints it when he's in the office. I have a few jobs that i send by email instead of printing. The down part is you need to create a device in Baan for every emails or group of emails that you want to send the document.

PB.

ken bohnenkamp
6th March 2009, 14:33
What is a pseudo printer and can you send me an example of how I would set one up.

blanchap
6th March 2009, 16:35
First, you need to make sure that your mailx is configure in Unix. You can ask your HP admin about it.

Then, you need top create a file in your $BSE directory in Unix.
let's say email_ur as an example.

In email_nalli you will have:

cat "$1" ltr -d `echo "\015"` > "$1""nalli"
echo "$2" "$3" "$1"
uuencode "$1""nalli" file.txt | mailx -m -s "File from Baan" login@domain.com
rm "$1""nalli"

I'm sure that you'll understand that login@domain.com is the email that you want to send the file to.

In Baan, you define a device as:

Device : EMAIL-NALLI
Description : Email report to user
Device Type : Direct
Locale :
Printer -----------------------------------------------------------
Driver : ps
Device Queue : ${BSE}/email_nalli %s
Paper Type : LGL-LN Legal Landscape Landscape
Left Margin : 0 Form Feed : No

In in this example, i'm printing it on a legal landscape, for your statements, change the paper type to be letter
Make sure that the driver is ps (for postscript)

All you need to do is set your statements in a job and print to the new device.

The hic part is you need to create a file and a device per user or group that you want to send an email with the job deamon. Did not find way yet to pass the user's login as a parameter to the file in Unix (still working on it). :confused:

The fun part is that i use this option (email) in all my reporting so that the user will have a choice of printing the report or receiving it in an email. In Baan, i'm able to catch the user's login (logname$) and call the mailx command with a shell() and send it by email. :D

Let me know if you have trouble with this.

Have fun.

PB.

pbenven
27th March 2011, 22:04
PB,

I used your example above and combined it with the PRO version of txt2pdf so I could include a letterhead:

#!/usr/bin/sh

OUTFILE="$1"$LOGNAME
CFG_FILE=/opt/mk/bse6.0/lib/pdfmail/cfg/letter.cfg

cat "$1" `echo "\015"` > $OUTFILE
/usr/local/txt2pdfPRO-10.1h/txt2pdf -configure $CFG_FILE $OUTFILE
uuencode $OUTFILE".pdf" FromMK.pdf | mailx -m -s "File from MK" $LOGNAME
rm $OUTFILE".pdf"
rm $OUTFILE

I updated the sendmail /etc/alias file with everyone's email address so $LOGNAME resolves.

Also, I set ${LOGNAME} as the Device output file to avoid conflicts in case several users run the script at the same time:

Device : EMAIL_LETTER
Description : Letter-sized email attachment
Device Type : Rewrite file
Locale : ISO-8859-1 Western Europe - 8 bit
Printer
Driver
Device Queue
Paper Type
Left Margin : Form Feed :
File :
Driver :
Shell Command :
4GL Program : ttstpconv
Argument : ASCII\${BSE}/lib/pdfmail/letter %s; rm %s
Path : ${BSE}/lib/pdfmail/scratch/${LOGNAME}
Change allowed : No
Page Length : 66

The MK interface is a little different, but I think we all get the idea. Thanks for the inspiration.

Antaras
5th May 2011, 16:00
use a print management solution like unispool/printtaurus to solve this problem. Solution recoginize the print file as being the file of statements , and put the file on hold until the predefined time is there to be printed. In baan the print job can be generated at the normal time as always.. This way you ensure that the statements only will be printed once the employee. Solution offers you also the opportunity to automatically redirect the print job to another printer incase of a jam-- also to ensure the required documents are printed. Or alerts can be generated once printing goes wrong. Ensuring guaranteed delivery of your output and more control over the environment( both Unix /Windows even if the print files goes via remote systems)

toolswizard
19th May 2011, 21:37
Use Infor ES Reporting Service to be able to use windows print queues instead of Unix. On Windows create two printers that point to the same physical printer. In the properties of one, change the availability to the hours the person should be allowed to print, the customer statement to the second printer.

You could also set up security that the person could never select the printer that is always available.

Also check to see if the printer has a secure print feature. then the job would be queued until someone releases it from the printer console.