OIPI Paperbin How to use letterhead tray and plain paper in same report? (OpenInsight Specific)
At 21 DEC 1999 03:16:04AM Scott, LMS wrote:
Hi All
I am trying to get an OIPI report to print to the letterhead tray (eg manual or upper tray) for first and third every odd page, and to print to plain paper for every second, fourth and every even page.
I currently have something like
letterhead_bin=1
plainpaper_bin=2
stat=SET_PRINTER (INIT, stuff)
LOOP
stat=SET_PRINTER ("PAPERBIN", Letterhead_bin)
print letterhead page egstat=SET_PRINTER ("ADDTABLE", letterhead stuff)
throw to new page for plain stuffstat=SET_PRINTER ("PAGEBREAK")stat=SET_PRINTER ("PAPERBIN", plainpaper)stat=SET_PRINTER ("ADDTABLE", plain stuff)
throw to a new page for letterhead againstat=SET_PRINTER ("PAGEBREAK")UNTIL pages_all_printed
REPEAT
stat=SET_PRINTER("TERM")
With this configuration I get the whole report on plain paper!
I have tried fiddling with putting the paperbins before and after the page breaks but so far my aimless wanderings have gotten me nowhere useful. I swear it did print the same report to two different trays once but I forget how it did it. It certainly didn't get the page mix right ie the letterhead details did not go to the letterhead tray. I think it printed the first page on letterhead and all subsequent pages on plain paper.
I have checked the stat's for dodgy codes but they seem ok. I got GET_PRINTER('PAPERBINS') to work once but after that all the get_printers on this theme crashed. The stat for that was 1,2,4 ie upper, lower, manual.
We have win95, OpenInsight 3.7, OIPI 3.8 and Novell NLM
The printers are HP Laserjet 5 and HP Laserjet 5P which both have a manual feed and a paper tray. It doesn't seem to matter if I use 1 or 4 for the letterhead_bin, it still ignores me.
Any ideas please.
Thanks
Scott
At 21 DEC 1999 04:28AM Oystein Reigem wrote:
Scott,
I tried here now with my HP LJ 5M and a mix of 7 (auto) and 4 (manual) and got everything on auto.
Perhaps it doesn't work?
Or perhaps you can have only one PAPERBIN change in a print session? (Unless you're Norwegian, because I can't even get one.) Could that explain that you once got the print in two bins? Let's say you forgot the first PAPERBIN, or had an erroneous PAPERBIN that went undetected, so you got the first part of the print with a default bin setting, or a previous setting?
I don't know how much one can trust the PAPERBIN stats. I tried the illegal (?) PAPERBIN value 99 which went through undetected. (But -99 or no value got me an error status all right.)
Speaking of which (i.e, no value) - your
stat=SET_PRINTER ("PAPERBIN", plainpaper)
should of course be
stat=SET_PRINTER ("PAPERBIN", plainpaper_bin)
- Oystein -
At 21 DEC 1999 04:50AM Oystein Reigem wrote:
Scott,
Should the PAPERBIN messages go elsewhere? In my other response I said I got everything on auto. I then used a loop like yours, with
PAPERBIN auto
ADDTABLE
PAGEBREAK
PAPERBIN manual
ADDTABLE
PAGEBREAK
When I move the PAPERBINs like this
ADDTABLE
PAPERBIN auto
PAGEBREAK
ADDTABLE
PAPERBIN manual
PAGEBREAK
I get everything on manual!
I also try to switch the auto and manual sections of the loop body:
PAPERBIN auto
ADDTABLE
PAGEBREAK
PAPERBIN manual
ADDTABLE
PAGEBREAK
Result: Still all on auto.
Conclusions: ???
- Oystein -
At 21 DEC 1999 04:53AM Oystein Reigem wrote:
Correction:
That last loop body should have, like I wrote in the text, the manual section first
PAPERBIN manual
ADDTABLE
PAGEBREAK
PAPERBIN auto
ADDTABLE
PAGEBREAK
- Oystein -
At 22 DEC 1999 01:18AM Scott, LMS wrote:
Hi Oystein
Thanks for trying out all those options for me. I am beginning to think I was imagining things when I thought it printed on different trays for one report. Your experience reflects mine, in that it doesn't seem to matter where I put the paperbin command, the last one encountered seems to be the only effective one.
I think I will email the splaver guy direct and if I get a useful response I will post it in here.
Scott
At 22 DEC 1999 02:48AM Barry Stevens wrote:
Have you tried a set_printer("TERM",1)
At 22 DEC 1999 03:47AM Oystein Reigem wrote:
Barry,
I don't think that would help. See my latest response to Scott.
- Oystein -
At 22 DEC 1999 04:12AM Oystein Reigem wrote:
Scott,
Almost got it to work. I got print to switch back and forth between auto and manual with the last 3 out of 4 pages correct. Perhaps there's just some initializing trouble. But I haven't got time to pursue this further.
What I did was to put each page in its own print session:
INIT
PAPERBIN auto
ADDTABLE
TERM 0
INIT
PAPERBIN manual
ADDTABLE
TERM 0
No need for the PAGEBREAK now of course.
(TERM 0 is probably the same as just TERM since 0 is default).
Note! You have to turn preview off for this (INIT PrintSetup=0). I did all my earlier experiments with preview. Don't know if that made any difference.
Btw - the way my PC or network or print server or printer or whatever is set up I get a header page for each print session. (All the header pages went to auto.) So my suggestion of splitting into a lot of sessions is not good if you need this to run in an environment where the user usually gets or needs header pages. There'll be a lot of work weeding out the header pages. And a lot of wasted paper.
- Oystein -
At 23 DEC 1999 10:46PM Barry Stevens wrote:
Separate sessions is what I was getting at
Bazza
At 04 JAN 2000 01:53AM Scott, LMS wrote:
Hi All
The following is what Tony sent me in response to my question. I haven't had time to try it out but I will try to clone myself into about 4 skilled programmers so I can. (more interesting than the rest of my work anyway). But I thought some of you might like to try it out.
Only one problem, client really does like the print preview. I don't think the banners will be a problem - you can turn them off.
Scott
From Tony Splaver:
Hi Scott,
There may be problems with the PAPERBINS message in the OIPI. I cannot test this feature, because I do not have a printer with more than one bin. Make sure you have the latest printer drivers from HP, because the printer drivers that come with Win9x are not compete and they do not always fully support the features like paperbins.
Try these things first:
1. Upgrade to OIPI 3.8 on a test OI, I would not recommend upgrading your production system yet. Older versions of the OIPI did not support this feature correctly.
2. Get the latest printer driver from HP's web site and install it on the Win95 computer that you are testing.
3. Try running the OIPI_TEST_BINS program below and let me know if this simple program works.
4. If this does not fix the problem, then I will build a special OIPI.EXE with more debugging information. This will help me find the root of the problem. Can you perform some testing with this special OIPI.EXE build if necessary?
Thanks,
Tony
function oipi_test_bins(d)
declare function Set_Printer
x=Set_Printer("INIT")
if x
***
At 04 JAN 2000 08:29AM Oystein Reigem wrote:
Scott,
Tony's code is very similar to mine.
You don't have to clone yourself too much to test this. E.g make a window with a button, and put Tony's code in the CLICK user event. Cancel the "function oipi_test_bins(d)" line, and make sure there is a "return 0" or "return 1" line at the end. Test run and click the button.
You remember I managed to get things to work only halfway here (with auto vs manual feed), but that might be because my printer drivers are not the latest version. To say the least.
…client really does like the print preview…
Could you somehow do it by printing print twice? First one with a preview and no print, and then - if the user's satisfied - one that's for real but with no preview? I don't know how to implement this, however, but perhaps Tony's got an idea.
- Oystein -
At 16 FEB 2000 11:37PM Scott, LMS wrote:
Hi All
I have been talking to Tony again. It seems (as we may have already guessed) that you can change paperbins if you go directly to the printer but print preview mode eats the change tray commands.
So if you display the report first in print preview mode and print it from there, it will all print to the same tray no matter what.
Scott
At 17 FEB 2000 09:37AM Don Bakke wrote:
Another suggestion that we have used is to create another printer definition and have that printer set to the appropriate paper bin. Then this printer is auto-select by the OIPI. It's not quite as simple as having the OIPI simply change bins for us but it works in print and preview modes. Another bonus is that the printer won't automatically pull from an available tray if the designated tray is empty, which is not the case with the PAPERBIN message.
dbakke@srpcs.com