dreport spools output to wrong printer
Barry Wiseman
duck at gensoftdes.com
Sun Jul 31 17:53:45 PDT 2005
On Sun, 31 Jul 2005, Brian K. White wrote:
> > Kenneth Brody wrote:
> >> Quoting Barry Wiseman (Fri, 29 Jul 2005 15:58:10 -0400):
> >>
> >>
> >>>Spent this afternoon pounding my head over a report that filePro was
> >>>stubbornly sending to the wrong printer.
> >>
> >> [...]
> >>
> >>>config file had (irrelevant entries omitted):
> >>>
> >>>printer7 = jeff,dr_hp3,lp -s -djeff,Jeff's printer
> >>>printer8 = mary,dr_hp3,lp -s -dmary,Accting printer
> >>>printer9 = dr_hp3,dr_hp3
> >>>
> >>>Output table had Printer name: dr_hp3
> >>>
> >>>With no -p on the command line, no value in LPDEST, no "printer"
> >>>statements in processing, I would expect the report to go to the default
> >>>printer, "hp8100". Instead, it was going to "jeff".
> >>
> >>
> >> The output format had the printer name "dr_hp3". Therefore, since
> >> printer7 is of type "dr_hp3", it went there. (That is, "jeff".)
> >>
> >> Why would you expect filePro to go to the default printer, when the
> >> output format specifies "dr_hp3"?
> >>
> >> This is the expected, documented behavior.
> >
> > I thought the "Printer name" in the output format refers to entries in the
> > "Name" column in pmaint. You're telling me "Printer name" specifies not
> > printer name but printer type. Silly me.
> >
> >> It's still picking printer7 (the first "dr_hp3"). However, since
> >> this has no destination specified, it uses the default.
> >
> > It does *not* use the default. Whose default? Filepro's?
> >
> > pfprinter = default
> > printer1 = default,default,lp -s
> >
> > Linux's?
> >
> > system default destination: hp8100
> > device for hp8100: socket://192.168.1.4:9100
> > device for jeff: socket://192.168.1.5:9100
> > device for mary: socket://192.168.1.6:9100
> >
> > Seems to me only by specifying printer name "jeff" (either in the output
> > format or in processing) should filePro ever launch an "lp -djeff"
> > command.
> >
> > Let's render this more generically:
> >
> > printer1 = foo,laser,lp -dprinter1
> > printer2 = bar,laser,lp -dprinter2
> > printer3 = laser,laser,lp
> >
> > Doesn't this mean that 'printer name "foo"' would use printcode table
> > "laser" and spool output to printer1? And 'printer name "laser"' would
> > again use printcode table "laser" but spool to the OS's default printer?
>
> Barring the presence of any of these
> PFPRINTER # obvious
> LPDEST # does this even mean anything on linux?
> PRINTER # linux's version of LPDEST
> PFPT # overrides everything if the termcap has PN & PS
> in either the environment or the fp config file, then yes that is how it
> should work.
>
> > Problem seems to be the use of "laser" as both a printcode table name, and
> > also a printer name. Is this an unexpected event in filePro?
>
> I only recently hit what I thought was a bug (but wasn't) about that very
> question.
> Although pressing F6 to select the printer in define output shows you a list
> of types as well as printers, you need to select a printer not a type that's
> only a type.
> I used to think it was a way to hard code the print code table without hard
> coding the the physical destination, until the first time I actually tried
> to do it and got an error about no such printer, using default.
>
> As for the duplicate name, we usually have a printer named hplaser and
> usually but not always it's also the default. I haven't ever had a problem
> with having the wrong printer used than the one I wanted, but it might be
> just because I happen to always have a pfprinter in the config file and and
> always have something in the destination field. I sometimes don't have a -d
> destination flag but always at least some kind of command, generally
> "lp -s -o raw".
>
> There is an exception to that "always". I sometimes have a printer defined
> just to define it's print code table, and no destination at all, but I only
> use that printer in combination with PFPT, and that also always worked as
> expected, except on linux where it crashes if -pq is used and there is any
> destination-less printer definitions in the config file.
>
> Your real example has no destination, your mock example has at least an lp
> command. You didn't mention PRINTER or PFPT.
>
Brian, thanks for your comments. I have no PFPRINTER, PRINTER or PFPT
set.
Your remark about the F6 list is illuminating. I never use it, having
concluded many years ago, "hmm, it lists each printer twice, what a
broken piece of crap this is." I now realize, as you observe, that
the list comprises printer *names* (printer* entries in config) as well
as printer *types* (.prt files in fp/lib). So there's clearly some
confusion between the two, which has bitten me here.
In my example, the printer entry with no destination command works
perfectly (i.e., pipes to the default spool device in the current
environment) if it is the first in the table *for that printer type*.
If instead the "jeff" printer name appears first, that one is selected
when I say 'printer name "dr_hp3"' -- simply because fP is finding the
first entry whose printer *type* is dr_hp3. Note that I am not specifying
a printer *type*, only a printer *name*.
Since, as we see from the F6 behavior, filePro has routines which
inappropriately lump printer names and printer types together, I say that
what I am experiencing is an unintended behavior (read "bug"). :-)
It's no biggy, the workaround is simple enough as I'd already discovered.
And I'm sure some would say the use of the same string as a printer name
and also a printer type is poor and obfuscated programming practice.
Just thought I'd post about this and save others from getting bitten.
-----------------------------------------------------------------
Barry Wiseman barry at gensoftdes.com
Genesis Software Designs, Inc. Voice: (212) 889-9191
18 E. 41 Street, New York, NY 10017 Fax: (212) 889-1589
-----------------------------------------------------------------
More information about the Filepro-list
mailing list