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!

Repeating detail lines

Status
Not open for further replies.

par60056

Programmer
Jul 16, 2001
31
US
Does anybody have a GOOD way to cause a detail line to be repeated?

For example say I am trying to create a receipt for purchased items. I want to print out the information about the purchased item QUANTITY times. (I know add a quantity field to the receipt, but this is an example not what I really need it for)

So I want to print something like:

Can of Soup
Bag of Chips
Bag of Chips
Bag of Chips
Bag of Chips
Tub of Chip Dip
Case of Mountain Dew
Case of Mountain Dew
Case of Mountain Dew

from the records:
"Can of Soup",1
"Bag of Chips",4
"Tub of Chip Dip",1
"Case of Mountain Dew",3

TIA
Peter Richardson
 
One way is to create 10 subsections, each identical, but with different suppress conditions like:

Qty >1

Qty >2

Qty >2

Qty >3

You have to create enough subsections for the highest possible quantity. Of course, these are repeating lines, not repeating records, and therefore have to stay together.


Another technique requires adding a table that forces table inflation. Create a table that has x records in it with a numeric field numbered 1 - x. Link your quantity to this field using a "Greater than or equal to" join.


Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Thank you. Those were exactly the 2 solutions I came up with. It is good to see that I didn't miss anything.

I think in my case the second solution (joining to a sequence table and duplicating the records) will be the better choice. Rarely will it need to duplicate more than 5 times, but every once in a while somebody does something strange and I have seen as many as 75. This would make duplicating the section a bit difficult to plan for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top