Focal Point Banner

As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at and provide your corporate email address, company, and name.

Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     auto print in Web Focus

Read-Only Read-Only Topic
auto print in Web Focus
Gold member

I need to auto print the pdf files depending upon the selection on the html file .Once the parameters are entered in the html,the fex file get executed and the pdf files are generated. Our current situation is the user needs to open the pdf manually and get it printed.

But the user needs to auto print the pdf files without manually opening it.I have tried the following options to do this:

The following is an example of the code:




I have tried the following:

DOS PRINT /D:\\Device C:\WORK\TEST1.PDF also I have tried using DOS COPY .when I executed the fex I’m getting the error message as 0 number of records in table. It’s possible for me to manually open the pdf and see the content but it’s not possible to auto print it.
I have tried the PS Format too but I got the error message as 0 PS file saved. Any suggestion for this issue is highly appreciated. I’m using Web focus Developer Studio version: 7.1.7

Posts: 80 | Registered: March 21, 2007Report This Post
Silver Member
posted Hide Post
Hmmm...I really don't think that this is possible? It is my understanding that when FOCUS passes the control over to "3rd party" PDF or Excel, the control is in the hands of that software. I guess the real question would be can you get ANY PDF to print automatically? Maybe if you search PDF's website? Is there an autoprint in Javascript?

Not to be a do-gooder or get on a soap box of any kind, why would a user want to do this? It could potentially be an awful waste of paper/trees.

Good luck,

last version used: v7.1; truly miss the wonderful things I did with WebFOCUS, HTML, & JavaScript.
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007Report This Post
posted Hide Post
passes the control over to "3rd party"
when you're using PCHOLD. When you're using HOLD, the file is created in the designated location on the server and the program continues, so, you should theoretically be able to automatically print the PDF file. Dn't forget that this is happening on the server, so the printer must be addressable by the server.

Your example shows FILEDEF is PDF, but the format is WP - it should be PDF.


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
posted Hide Post
Usually if you want to "auto-print", you use format PS, not PDF. It behaves almost the same, but can be printed via an operating system command (at least in Unix and Windows).

(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
posted Hide Post
PDF and Postscript(PS) are their own "languages" (sorry couldn't think of a better term). If you open a PDF document in a text editor, you can see that it contains more than just what you see on the report. If it contains images, embedded fonts, lines, etc., those are all written into the document. So naming the file with a .PDF and holding format WP is like calling an elephant a duck. You can call it whatever you want but it's still an elephant.
That being said, here's a couple suggestions. As mentioned, if you want the output to be sent directly to a printer, hold format PS, then use a system command like lineprint to print it natively(lpr -S printer IP -P printer queue/DEFAULT filename).
You could also set up FEX that could be scheduled dynamically in ReportCaster and use RC's printer distribution functionality. Note that both of these require that the printer must be postscript-capable. More and more business-class printers these days come with the functionality built in, but many require an additional module or do not have this functionality at all.
Last, most printers, by theirselves, do not understand what a PDF document is. If you use a DOS print command, you just get a bunch of text. It must be manually opened and printed from an application like Adobe Reader. However, many printers now have multiple queue functionality and are smart enough to pick up a document in a specified queue and handle it differently than other queues. This gives it the ability to pick up a document sent to a "PDF" queue render its image in a PDf document, and then print it. We're probably talking $$$ here if you don't currently have that functionality.



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
posted Hide Post

Your issue might be on the DOS PRINT command. Were you able to do a DOS PRINT outside of WebFOCUS? This can be tricky if your are using a TCP/IP Printer.

WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
Posts: 285 | Location: Texas | Registered: June 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     auto print in Web Focus

Copyright © 1996-2020 Information Builders