Here is a sketch of a solution:
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.
Jonathan S. Levinson
Senior Software Developer
From: InterSystems-ZEN@googlegroups.com [mailto:InterSystems-ZEN@googlegroups.com] On Behalf Of Lori Fassman
Sent: Thursday, March 12, 2009 7:37 PM
To: InterSystems: Zen Community
Subject: [InterSystems-Zen] Re: Automatic Printing of ZEN Reports
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?)
On Feb 27, 6:50 am, "Jonathan Levinson"
> 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
> 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
> -----Original Message-----
> From: InterSystems-ZEN@googlegroups.com
> [mailto:InterSystems-ZEN@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
> 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.