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 TouchToneTommy 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 1

Status
Not open for further replies.

ggrewe

IS-IT--Management
Jul 10, 2001
169
US
In VFP 7, is there a way to print multiple copies of the same report without calling the report form twice? For example, I have a cursor with 51 records and I want collated copies of the report. Right now I do the following;

Code:
for i = 1 to alen(idnumber)
   for n = 1 to number_of_copies
     report form reportname for id = idnumber[i,1] to printer noconsole
   endfor
endfor
is there a better way? Can I just do something like;

Code:
select("cursor")
report form reportname to print noconsole 2_copies
Thanks for any advice.
 
Our customer wanted three copies of a delivery note. I did this by having a control table to control the number of copies required. This had a single field named "Destination" with three records holding "Customer", "Despatch", and "File".

When I run the report I do a cross join between this table and the cursor driving the report:

Select source.*, control.destination ;
from source, control ;
order by source.order_id

This links every record in the destination table (all three of them) with every record in the report's cursor so that I get a new cursor holding three copies of the original cursor, one each for Customer, Despatch, and File. Ordering the cursor by order ID collates the output so that the three copies of each delivery note come out together.

Geoff Franklin
 
Geoff, Thanks for your tip, I think this will work great. Thank you and have a good week.
 
ggrewe,

You can also open the report up as a table and go into the expr field and change the value for Copies=1 to Copies=5 or whatever.

This may or may not be a viable solution for your particular situation. If the number of copies is static, in other words you always want 5 copies or sommething then you can make the change at design time, compile and upon printing you will get 5 copies of the report.

If the number isn't static then you can still facilitate this by excluding the report from your project and including it with the application install... then when the user runs the application just allow them to select a number of copies (or however the dynamic number of copies is figured) and make the change to the report frx file just prior to running it.

Works slick either way and doesn't require undo looping structures or large redundant queries being run. Whether it is a better solution than you already have does depend alot on what your requirements are and such. Just figure it might be something to consider or keep in mind.

boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top