Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer control codes

Status
Not open for further replies.

MarkB2

Technical User
Oct 27, 2004
28
US
I have a report which prints daily about 500 pages. I would like to print it in duplex mode to save on paper. The difficulty is that there are breaks by sales person. I need to insure that each sales person starts on an odd page number so the back of a page does not start the next person.

My first thought was to do a select distinct salesid and then print the report in multiple passes, one for each salesid. Another would be to insert a page break if the current page was even in the header for the new sales person.

A second need is to switch paper bins. I want to print checks and stubs. The stubs would have the detail for the check. In some cases the detail will not fit on one stub and I would like to just switch to a plain paper bin when I need to print overflow pages.

If the report writter can't handle this is there another way?

TIA
Mark
VFP7 currently
 
Hi

AT the group footer level.. check for the _pageno and if
IIF(MOD(_pagen0,2)#0, eject,"")
This will skip the page as and when required.

Make sure that the _pageno is starting at 1 for each new group.

:)

____________________________________________
ramani - (Subramanian.G) :)
 
I created a text box and placed the following code in the expression.
When I run the report I get "Variable 'EJECT' not found.
Code:
IIF(MOD(_pageno,2)#0, eject,"")
Did I need to do this some other way?

Mark
 
All that did was insert the character into the report. When shown on screen you see a small square box. When you print it I get a verticle bar.

It appears that it is being interpreted as a character which is part of the report, not a printer control code.
 
Have you tried putting it into the footer band

Select report/bands dble click on page footer and you have an on entry on exit expression area.

Bob Palmer
The most common solution is H2O!
 
I put the code IIF(MOD(_pageno,2)#0,CHR(12),"") into the footer band "on exit" and as far as I can tell it had no effect. The report ran OK, I mean without errors, but it did not cause an eject to a new page either.

I can't put it into "on entry" as I do have totals to print in the footer.
 
Try adding a function to your procedure file or main program called 'MyEject' or something. You can then call it like this:

Code:
IIF(MOD(_pageno,2)#0, MyEject(),"")


*... in your procedure file
FUNCTION MyEject

EJECT
RETURN ''

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave I tried the above and the ehect does work but it seems to be sent to the printer before the report is sent to the printer. What happens is a page is ejected and then the report prints as though the EJECT was not there.

I am going to change the report print process to issue the "report form" ultiple times, once for each person.

Thanx for trying
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top