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 a record a variable number of times

Status
Not open for further replies.

JVV

Technical User
Aug 14, 2001
4
US
I would like to print a record a variable number of times based on the value in a field in the record. It has been suggested that I create multiple detail sections and suppress those not needed, but that will not work because I will never know what the maximum number of sections needed would be. It seems that I should be able to use a "do while" or something similar but I just can't get it to work. Any sugestions would be greatly appreciated. Thanks in advance.
 
Create a table that has the numbers one through 1000, or whatever is a reasonable maximum number of records you would want. Join this table to your database table on the qty field with a less that or equal to join.

If the Qty in your database record is 8, it will find 8 matches in the new table, if it is 20, it will find 20 matches, etc. This is what happens all the time when we write report on multiple tables with many to one relationships, only now we are doing it ON PURPOSE.

Ken Hamady had a good article on this sometime back, called "record inflation". Check out his website - - and look at the back issues of his newsletter.

Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
I understand what your saying and thank you. But, the only thing I'm getting is the exported data from the database and I would have to go back to the vendor to add the table, which equates to $. I'm trying to set the report up so that the users can just execute and get the record printed the variable number of times, as needed. I thought there would be a way to loop and accomplish this, essentially I guess I would want Crystal to act like it was reading the record "n" times.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top