powerh-l digest, Vol 1 #498 - 5 msgs
Seamus at partage.org
Seamus.Browne@partage.org
Sat, 9 Nov 2002 18:03:39 +0100
From: "Hasse, Christina" <Christina.Hasse@COGNOS.com>
Hi,
Has anyone been able to come up with a technique which allows Quiz with a
Windows command to produce a report that controls the printer of choice
along with the option of Portrait or Landscape without user interference?
Regards,
Christina Hasse
----------------------------------------------------------------
Well I think there are two ways of understanding the question.
First way : You want Quiz to actually print the report and just use Windows
to specify some options before the report is run?
Second way : You want Quiz to send the report to a Windows machine and then
use a Windows based application handle the formatting and printing ?
---------------------------------------
Here's how I would manage the first way.
The idea is to FTP snippets of Quiz code from the Windows machine into the
Quiz just befor it runs.
On the PC, You need to create as may text files as there are options.
Say you have 7 printers, then you will need 7 text files that contain the
QUIZ statements that specify the printer options.
On a HP 3000 this would be something like
--------PrinterFile1.txt ----------------
:FILE LP1;dev = 127
SET REP DEV PRINT NAME LP1
EOF
--------PrinterFile2.txt ----------------
:FILE LP2;dev = 17
SET REP DEV PRINT NAME LP2
EOF
etc.
In the Quiz run you would have to use 3 DEFINEs
1. DEFINE ESC char * 1 = car(27) (Something like that , I'm doing this at
home, from RAM memory.)
2. DEFINE PORTRAIT char * 10 = ESC + whatever control code your printer
needs for portrait
3. DEFINE LANDSCAPE char * 10 = ESC + whatever your control code printer
needs for landscape
For the Landscape / Portrait option you would need to create two separate
text files on the PC. In each one you define a the PAGE HEADING.
and, in that Page heading, iclude the option you want : PORTRAIT or
LANDSCAPE
as in "TAB 01 PORTRAIT" or "TAB 01 LANdSCAPE"
So as well as the seven files for choosing the one of the seven printers you
should also have
two files for choosing the page orientation.
--------Portrait.txt-------------------
PAGE HEADING TAB 01 PORTRAIT &,
TAB 20 "MONTHLY REPORT" &,
TAB 50 SYSDATE &,
TAB 72 SYSPAGE
EOF
--------Landscape.txt-------------------
PAGE HEADING TAB 01 LANDSCAPE &,
TAB 20 "MONTHLY REPORT" &,
TAB 50 SYSDATE &,
TAB 72 SYSPAGE
EOF
Then the user has 14 different icons in a special folder.(!!!)
Each one of the icons runs particular .bat file which in turn runs an FTP
coammand
combined with a corresponding FTP script and emulator (Reflection ?) script
to logon and then run the Quiz.
So, something like this :
-------------PRINTER4_PORTRAIT.BAT--------------
FTP.exe -s:PRINTER4_PORTRAIT.SCRIPT
Reflection.exe /RBS MonthlyReprt.rbs
EOF
In the FTP script "PRINTER4_PORTRAIT.SCRIPT" you would have the following
commands :
open IP_of_Quiz_machine
user username
pass password
ASCII
put PrinterFile4.txt PRT_OPT
put Portrait.txt PAGEHEAD
quit
In the emulator script just a logon and a run of the Quiz.
In the Quiz do not pecify a printer.
Instead use "USE PRT_OPT"
In the Quiz do not pecify a page orientation.
Instead use "USE PAGEHEAD"
When the Quiz runs it will pick up the options from those files.
----------------------------
Or maybe we could do it the other way round ?
leave the option files an the Windows machine
and get the Quiz to download them at the start of the run and just before
the USE.
Why not ?
----------------------------------------
--------------------------------
For the second way, Tim's idea is fine..
But here is another second way.
as Tim Cummings indicated, you have to FTP the Quiz report
over to a Windows machine somewhere on the user's network,
[or else set up Samba :( !!]
On a HP3000 the :FTP command and subsequent logon and transfer commands
can be included in the job that runs the Quiz report.
You could then set up a Word document
with nothing else in it but a field referring to the
Quiz report:
Do this via Menu/Insert/Field/INCLUDETEXT
then you have to key in the path and name of the file.
N.B. 1. Path names or File names that have spaces have to be between
inverted commas
N.B. 2. Backslashes may have to be doubled on some systems/versions. Don't
ask me why.
You should end up with a field that looks like this
{INCLDETEXT "C:\Reports\Stats1.txt" } - or -
{INCLDETEXT "C:\Reports from Quiz\Stats1.txt" } - or -
{INCLDETEXT "C:\\Reportsfrom Quiz\\Stats1.txt" }
whichever works.
N.B. 3. No those are not ordinary squiggly brackets.
They are special Winword brackets that indicate
that the included text is a winword field and not just ordinary text.
They should appear when you Insert the field.
You can toggle between viewing
the field itself
and the contents of the file it refers to
by using a right click and the toggle option.
If you then set up the printer options and save the doc as a template
then the user will have your options when the doc is opened.
You could also password protect the doc.
That way your options would be protected.
This way the user could still choose the printer.
The INCLUDETEXT field has a MERGEFORMAT option that you coould look into to
modify the style of the data.
Phew, that was a bit long wasn't it ?
Seamus