February 21, 2007, 01:45 PM
KentODirectly print reports from WebFOCUS
I need to print reports with a STYLE sheet directly from WebFOCUS 7.6 without first opening the file with Adobe. I now get simple text using the following examples:
Example 1:
FILEDEF HOLDPRT DISK C:\WORK\HOLDPRT.WP
SET PRINTPLUS=ON
SET STYLEMODE=PAGED
TABLE FILE FANNAMES
PRINT TITLE AS '' FIRSTNAME EMAIL
BY LASTNAME
ON TABLE SET STYLE *
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1,FONT=COURIER, SIZE=40,STYLE=BOLD, $
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=3,FONT=COURIER, SIZE=40,STYLE=BOLD, $
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=4,FONT=COURIER, SIZE=40,STYLE=BOLD, $
ENDSTYLE
ON TABLE SAVE AS HOLDPRT FORMAT WP
END
-RUN
DOS COPY C:\WORK\HOLDPRT.WP LPT1
Example 2:
OFFLINE
FILEDEF OFFLINE DISK C:\WORK\HOLDPRT.TXT
TABLE FILE FANNAMES
PRINT TITLE AS '' FIRSTNAME EMAIL
BY LASTNAME
ON TABLE SET STYLE *
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1,FONT=COURIER, SIZE=40,STYLE=BOLD, $
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=3,FONT=COURIER, SIZE=40,STYLE=BOLD, $
TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=4,FONT=COURIER, SIZE=40,STYLE=BOLD, $
ENDSTYLE
ON TABLE SET PRINT OFFLINE
END
-RUN
DOS COPY C:\WORK\HOLDPRT.TXT LPT1
I also get plain text using .PS instead of .WP.
Kent
February 21, 2007, 02:25 PM
Tom FlynnKent
quote:
ON TABLE SAVE AS HOLDPRT FORMAT WP
Try:
ON TABLE SAVE AS HOLDPRT FORMAT
HTMTABLEFebruary 21, 2007, 02:50 PM
N.SelphFormat PS should work with your PDF stylesheet. It should be almost identical (except PS won't squeeze a few % to fit the page like Adobe Reader does).
February 23, 2007, 09:30 AM
KentOMy issue is that I need to print the file directly without manually opening it with adobe and then clicking on print. After I create the hold file with "ON TABLE SAVE AS HOLDPRT FORMAT HTMTABLE", I have tried to print the file with either "DOS PRINT /D:LPT1 C:\WORK\HOLDPRT.HTM" or "DOS COPY C:\WORK\HOLDPRT.HTM LPT1". Is there a way to directly print in WebFOCUS without manually opening the file first.
Kent
February 26, 2007, 10:59 AM
KerryHi Kent,
One of our internal people reviewed this topic and suggested that it is not believed that there is a way to do this from WebFOCUS (many thanks for everyone's input on this topic
). It is recommended that you open a case with Information Builders' Customer Support Services and submit a New Feature Request. To do so, you may either call at 1-800-736-6130, or access the online system InfoResponse at
http://techsupport.ibi.com. Here is a list of information to be ready when you call:
http://techsupport.ibi.com/before_you_call.jsp.
Hope this helps.
Cheers,
Kerry
February 26, 2007, 12:07 PM
<JG>In the good old days we used to do this sort of thing all of the time.
Very much depends on your make and model of printer and what exactly it is that you
want to print.
If it is something as simple as you show, all you need to do is include the correct control
Sequences.
For example the control for bold on an HP printer is ‘Esc s3B’
For courier font ‘Esc (s4099T’
You can obviously copy to your printer on ltp1 (unfortunately I cannot because I’ve only got a USB printer
not a good old parallel) so the escape method should work for you.
Each escape sequence that does something like BOLD,italic etc. has a corresponding
Sequence to turn it off.
In your case if it’s a simple listing where you want the first 3 lines bold and the rest normal
the following approach should work.
(the escapes sequences are best created in EDLIN and pasted into the focexec)
FILEDEF PRINTFILE DISK PRINTFILE.TXT (APPEND
-RUN
-WRITE PRINTFILE ‘Escs3B’ ‘Esc(s4099T’
-WRITE PRINTFILE Heading text line 1
-WRITE PRINTFILE Heading text line 2
-WRITE PRINTFILE Heading text line 3
-WRITE PRINTFILE ‘Escs0B’
TABLE FILE FILENAME
PRINT FIELDA
BY FIELDB
ON TABLE HOLD AS PRINTFILE FORMAT WP
END
-RUN
!COPY PRINTFILE.TXT LPT1
You can find the HP escape codes at
http://h20000.www2.hp.com/bizsupport/TechSupport/Docume...sp?objectID=bpl02705Most other printer manufactures supply similar
March 08, 2007, 04:21 PM
Carol DobsonKent,
We're on an older release of WF than you are, but, I opened case long ago on this same topic.
Here's what IBI sent to us to get this working;
The follwing is an example of sendingoutput directly to the Printer in PDF.
Example:
!NET USE LPT1 \\IBIPRINTA\28E2 /user:USERNAME PASWRD
SET ONLINE-FMT=STYLED
SET ORIENTATION=LANDSCAPE
SET PAGESIZE=LEGAL
OFFLINE
FILEDEF JASON1 DISK C:\TEMP\JASON1.PDF
TABLE FILE CAR
PRINT MODEL BODYTYPE SEATS
HEADING
"YES PS1"
ON TABLE NOTOTAL
ON TABLE HOLD AS JASON1 FORMAT PS
ON TABLE SET STYLE *
ENDSTYLE
END
!PRINT /D:LPT1 C:\TEMP\JASON1.PDF
I also support an old Focus Six for Windows app that runs a batch cycle where all the reports are sent directly to the printer overnight. It was a nice feataure, sure wish it was easier with WebFOCUS.
Good Luck,
Carol
March 08, 2007, 05:28 PM
susannahdo it in Caster , in html, and put in your printer address as the destination.