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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing odd or even pages from within foxpro

Status
Not open for further replies.

mike2p

Programmer
Jan 21, 2001
6
CY
Hi to all
We have tried to do this in foxpro but no luck.
We need to print the 'ODD' pages for a report and then prompt the user to reverse the paper stack in order to print the 'EVEN' pages.
Here is the code we came up with:

*******start of mikes code*******

*-- Find total no. of pages
REPORT FORMAT "Report.frx" TO FILE Temp.Txt NOCONSOLE
nTotalPages = _PAGENO

FOR nPartno = 1 TO 2
*-- Print odd or even pages
IF nPartno = 1
nStartPage = 1
ELSE
nStartPage = 2
ENDIF

FOR nOddEven = nStartPage TO nTotalPages SKIP 2
REPORT FORMAT "Report.frx" TO PRINTER RANGE nOddEven,nOddEven
ENDFOR nOddEven

MessageBox("Turn papers now",64,"Hello")
ENDFOR nPartno
*******end of code*****
Please tell us whats wrong with this code.
Thanking you in advance.
Regards
Mike


 
You could consider to use the external utility called Fineprint that handles all kinds of printing for you.

Saves a lot of coding.

HTH,
Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Hi Mike,

Please tell us whats wrong with this code.

It would definitely help others if you further define what you mean by this. Are you receiving an error or is the logic mistructured and thus the pages arent printing properly?

My first suggestion is to change the FORMAT to FORM in your REPORT commands.

FWIW, if you are trying to print duplex, check out the following KB articles:

HOWTO: Print Two Reports in One Duplexed Report

HOWTO: Control Printer Attributes for a Report at Run Time


Weedz,

if you are going to refer someone to a 3rd party utility, it would be extra helpful if you could provide a URL where they could obtain more info on the product. :) Jon Hawkins
jonscott8@yahoo.com

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Jon,

You are absolutely right. The utility can be found at:


HTH,

Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
You might also try the printer manufacturers website or driver documentation. Even our $200 color HP ink-jet has duplex driver. Send the print job once. The printer prints the odd pages then the driver prompts you to reinsert the paper. It even includes a little picture so you get the orientation correct. Pretty neat and pretty cheap (free).
-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top