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

How do I use somenthing like do..while or for to repeat data 1

Status
Not open for further replies.

fterrazas

Technical User
Dec 29, 2000
43
0
0
ES
Hi, I'm running a store so I have a little program in visual basic 5 that runs a store manager, I have a sticker utility that was made with Crystal reports version 4.6.1.0 so what I need to do is print a sticker with the name, location and prize for an article, the problem is that I have to do this for every article in the stock...Let me explain better if the article 'A' have 5 units in stock so I have to print 5 stickers, if the article "B" have 2 units in stock so I print 2 stickers...that's all I have is that the report in Crystal only print me one of each...Please help me
 
One option is to do this by conditionally suppressing detail sections. For example, if Quantity is 2, then show Detail_a and detail_b but suppress detail_c, etc.
Does Crystal 4.6 provide the ability to enter expressions in the Suppress attribute of a section?

Another, more elegant, solution requires that you create a new table in your database. Are you free to do that?

Cheers,
- Ido


CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I don't know well how to use crystal reports, I'm free to create tables and all that stuff, thanks for your help
 
OK, here's the table approach:

Create a "REPEATER" table with a single column (How_Many) that looks like this:

How_Many
--------
1
2
2
3
3
3
4
4
4
4
... (5x5 6x6 etc.)

If your database forces you to have a unique Primary Key in order to enter data, then also create a primary key column
with an auto_number or just enter a unique value there.

Now, in your report, join the {Quantity} field to the
{How_Many} field of this new table.

This would cause each product record to be duplicated as many times as the value of Quantity. For example, if a specific product record has a quantity of '4' it would
end up joined (and hence repeated) to 4 records in the REPEATER table.

Now, just print your labels... :eek:)

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top