Automatic Printing of ZEN Reports

71 views
Skip to first unread message

seppo

unread,
Feb 27, 2009, 5:14:07 AM2/27/09
to InterSystems: Zen Community
We have created a ZEN Report. As long as we view it in a browser (for
example as a pdf) everything is ok and I can print this report using
the functionality of the browser (IE in our case). Now we have the
problem that we need to print this report automaticly (meaning: no
human interaction) fom a Cache programm.

Does somebody happen to have a solution for this problem?

In the programm I can create the report and store it in a file (again
as a pdf).
I have already tried to print the stored file with $ZF and the
acroreader, this works only if I am logged in on the machine where
cache is running but not when cache is running as a service, nobody is
logged in on the machine and I start the programm from a telnet
terminal or the programm is started by a machine to machine
communication. So this easy one is not the answer I am looking for.

Jonathan Levinson

unread,
Feb 27, 2009, 5:50:26 AM2/27/09
to InterSys...@googlegroups.com
We are working on a solution to this problem and it will be in a
subsequent release.

We treat the acroreader the same way we treat XEP/FOP. We allow
defining a path to it and feeding the PDF to the acroreader to be
printed.

In the mean time, maybe someone else has a solution that does not
require our enhancement to ZEN Report printing.

Best Regards,
Jonathan S. Levinson
Senior Software Developer
Object Group
InterSystems
617-621-0600

Lori Fassman

unread,
Mar 12, 2009, 7:37:20 PM3/12/09
to InterSystems: Zen Community
Hi,

I have a customer asking a similar question. Does anyone have an
example of Cache' ObjectScript that automatically prints PDF reports
created by Zen? (I assume not since no one responded to this thread
just a few short weeks ago?)

Thanks,

Lori


On Feb 27, 6:50 am, "Jonathan Levinson"
<Jonathan.Levin...@intersystems.com> wrote:
> We are working on a solution to this problem and it will be in a
> subsequent release.
>
> We treat the acroreader the same way we treat XEP/FOP.  We allow
> defining a path to it and feeding thePDFto the acroreader to be
> printed.
>
> In the mean time, maybe someone else has a solution that does not
> require our enhancement to ZEN Report printing.
>
> Best Regards,
> Jonathan S. Levinson
> Senior Software Developer
> Object Group
> InterSystems617-621-0600
>
> -----Original Message-----
> From: InterSys...@googlegroups.com
>
> [mailto:InterSys...@googlegroups.com] On Behalf Of seppo
> Sent: Friday, February 27, 2009 5:14 AM
> To: InterSystems: Zen Community
> Subject: [InterSystems-Zen] Automatic Printing of ZEN Reports
>
> We have created a ZEN Report. As long as we view it in a browser (for
> example as apdf) everything is ok and I canprintthis report using
> the functionality of the browser (IE in our case). Now we have the
> problem that we need toprintthis report automaticly (meaning: no
> human interaction) fom a Cache programm.
>
> Does somebody happen to have a solution for this problem?
>
> In the programm I can create the report and store it in a file (again
> as apdf).
> I have already tried toprintthe stored file with $ZF and the

Derek Day

unread,
Mar 12, 2009, 9:02:49 PM3/12/09
to InterSys...@googlegroups.com
It seems like the easiest way would be be to set the output directory to a queue folder (or to move the pdf file to a queue directory when finished). I think I did something like this once upon a time -- maybe it was a feature of the printer driver that I was using?

Can Caché copy a pdf file to a printer device? or does copying the file to /dev/lpt1 (translate to the device naming convention for your platform).

Lori Fassman wrote (3/12/09 7:37 PM):

Jonathan Levinson

unread,
Mar 12, 2009, 9:39:20 PM3/12/09
to InterSys...@googlegroups.com
Here is a sketch of a solution:

s rpt=##class(MyPackage.MyReport).%New()
s tSC=rpt.GenerateReport("C:\TEMP\MyReport.pdf",2)
i 'tSC d DecomposeStatus^%apiOBJ(tSC,.Err) w !,Err(Err) ;'
Do $zf(-2,$zu(147,adobe)_" /t "C:\TEMP\MyReport.pdf"_" "_printer)

Outfile is the PDF file ZEN Reports generates. You can generate it using GenerateReport.

Adobe is the path of Adobe Reader.

Printer is a printer name say \\myserver\myprintername

The above is a Windows solution. A UNIX solution is similar. Using conditionals one can develop a unified solution.

Bill McCormick

unread,
Mar 12, 2009, 9:47:44 PM3/12/09
to InterSys...@googlegroups.com
We have implemented a print Business Process in Ensemble that can
handle these chores. I believe it is in 2009.1


Bill McCormick
Product Manager
Development Technologies
+1 617 621 0600
bill.mc...@intersystems.com

seppo

unread,
Mar 16, 2009, 4:34:32 AM3/16/09
to InterSystems: Zen Community
Hello Jonathan,

I tried your solution but it works only sometimes.
To be more specific. It is no problem to create the PDF file but the
printing works only on some installations.
Cache is in both cases running with an User that is local
administrator and both machines have Windows 2003 Server as OS. On one
machine it works on the other one it works when I start it from a
local telnet window and it doesn't work when started from an remote
telnet window. I have also a machine with XP (it works) and one with
windows 2000 (it doesn't work).

Does anybody has an idea why?

Seppo

On Mar 13, 2:39 am, "Jonathan Levinson"
> > communication. So this easy one is not the answer I am looking for.- Hide quoted text -
>
> - Show quoted text -

Jonathan Levinson

unread,
Mar 16, 2009, 9:37:34 AM3/16/09
to InterSys...@googlegroups.com
I suggest opening a WRC incident.

seppo

unread,
Mar 17, 2009, 6:03:41 AM3/17/09
to InterSystems: Zen Community
ok, I'll try that.

On Mar 16, 2:37 pm, "Jonathan Levinson"
> > - Show quoted text -- Hide quoted text -

Derek Day

unread,
Mar 17, 2009, 6:53:51 AM3/17/09
to InterSys...@googlegroups.com
It will be helpful to provide the subject line of this discussion to your adviser. Also, I hope that either you or your adviser will reply to this thread letting us know that a WRC investigation has been opened and including the WRC number in the subject line.

(I usually use square brackets, for example: Re: [InterSystems-Zen] Re: Automatic Printing of ZEN Reports [WRC 7nnnnn] ).

This is my personal preference, but I think it is good group etiquette whenever a discussion or investigation spans multiple forums.

Thanks,
Derek

seppo wrote (3/17/09 6:03 AM):

seppo

unread,
Mar 17, 2009, 7:22:44 AM3/17/09
to InterSystems: Zen Community
I opened a call and it got the number 703795

seppo

unread,
Mar 26, 2009, 6:01:03 AM3/26/09
to InterSystems: Zen Community
Hi,

here a report on the findings so far.

In Windows there exists a security policy:
"Devices: Prevent users from installing printer drivers"

on servers (2003 Server, 2008 Server, ..) this policy is by default
activated, on other systems (XP,...) it is by default deactivated.

if this policy is activated it prevents Acrord32 to see the printers
and therefore to print when the $ZF(...) is called from a remote
terminal or a background process, deactivating this policy seems to
help, at least in some cases.

Why this policy prevents a process from seeing an alredy installed
printer is probably one off the eternal enigmas of Windows. Why it has
an influence even when Cache is running with an administrator account
(the documentation says that it doesn't influence administrators) is
still under investigation.

I'll keep you informed on further findings.
Reply all
Reply to author
Forward
0 new messages