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 multiple copies

Status
Not open for further replies.

desert227

Programmer
Apr 8, 2008
13
CA
Is there anyway to find out how many copies of a report were printed. I have program where 3 reports are printed in a row. If operator selects 3 copies on first report print dialog, I want the following 2 reports (different frxs) to print 3 copies. I only have printer selection dialog on first report as usually they only want to print one copy of each. But of course someone wants multiple copies.....
 
One way would be for your application to control and count the number of times
REPORT FORM MyReport TO PRINT
was issued.

Instead of allowing "If operator selects 3 copies on first report print dialog", you could create your own form where the operator enters the desired number of copies and possibly the desired printer (using the APRINTERS() command).

Then your application has full control of what happens after that.

Good Luck,
JRB-Bldr
 
Thanks - I stuck a wait window _pcopies after the print but it was set to 1.... So your idea might be only way.
 
Another way would be to write a function which increments a counter in a table. Call the function from the report summary band. That way, the counter will be updated each time the report finishes, and you will be able to see exactly how many times that happens.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike - could I put a counter in a screen variable - say I set _screen.countit to 0 just before running report then in the function add 1 to _screen.countit etc etc
 
That didn't work - I selected 3 copies in print dialog and countit only set to 1 - I put the function in the summary band...

Iwill try other ideas and let you know
 
I selected 3 copies in print dialog

Sorry, I hadn't taken in that they were doing it that way (my fault -- you did make that clear in your original question).

The problem is that, as far as VFP is concerned, only one copy is printed. VFP will send one copy to the print spooler; it's the spooler or the printer driver that decides to print it three times.

As far a I can see, the only solution is to create your own dialogue for prompting for the printer, no. of copies, etc. Save the user's setting for no. of copies to a variable, then do your REPORT FORM in a loop, that number of times.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Hi Mike - I tried the function but no luck. Even moved it into the header, specified 3 copies but only got count of 1. The function is very simple - see below

_screen.AddProperty("countinfo",0)
DO FORM fesi501 && This form lets me enter custno then
wait window shows the count after report is printed using following:
REPORT FORM FESI501 NOCONSOLE TO PRINTER PROMPT



FUNCTION copycount
_screen.countinfo=_screen.countinfo+1
 
Is there bug in VFP - I tried following to get _pageno incremented but even with no reset and select 3 copies, _pageno came out as 1.


WAIT WINDOW _pageno
REPORT FORM FESI501 NOCONSOLE NORESET TO PRINTER PROMPT
WAIT WINDOW _pageno
 
Desert227,

I tried the function but no luck. Even moved it into the header, specified 3 copies but only got count of 1.

If you're referring to the function that increments the counter, it won't make any difference whether it's in the header or the report summary. Either way, it won't work, for the reason I mentioned in my previous post in this thread.

Did you try my suggestion of creating your own printer dialogue?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
That code didn't work - always returned 1 copy as well. I will try a simple form where the user can select printer, copies etc.
 
Sorry, but I think you're missing the point. The dialogue you found won't do what you want for exactly the same reason that the VFP built-in dialogue won't. The point is that your program has to actually print the multiple copies by calling the REPORT FORM command multiple times.

The reason to use your own dialogue is so that you can capture the user's choice of the number of copies within your program. You can then control the REPORT FORM command. That way, you will also know how many copies the user requested.

Hope this makes sense.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top