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!

crystal reports question

Status
Not open for further replies.

jazgeek

IS-IT--Management
Jan 29, 2004
541
0
0
I've posted this in the crystal forum but they're a bunch of snobs over there. So, I'll try here.


I have a label report I wish to print X amount of times where X is a field on the SOP10200 table called QUANTITY. How do I do this?

Thanks in advance


-----------
and they wonder why they call it Great Pains!

jaz
 
Crystal is driven by the details of the report. You are going to need to give Crystal a dataset that has one record for each time you want to execute the label report.

You could create a stored procedure to create the dataset.
For each SOP10200, create a temp table record with an entry for each customer x number of times up to the quantity in the SOP table.

example dataset to print 3 labels for 10207 and 1 label for 10517:

10207, 1
10207, 2
10207, 3
10517, 1

1. create your label report
2. create a new report with the main table being the stored procedure
3. insert the label report as a subreport in the details
4. the subreport link would be the key to get the label info, like customer number

This will make the label subreport execute for each record in the temp table returned from the stored procedure.

Hope this helps!
 
convoluted solution MColeman.

here's a simpler solution.... answering my own question I guess.


create a COUNTTABLE 1 column
LABEL
1
2
3
4
5
etc

add table to report having your SOP10200 table

link record selection as

SOP10200.QUANTITY >= COUNTTABLE.LABEL

you'll then get QUANTITY # of records for each SOP10200 line item.




-----------
and they wonder why they call it Great Pains!

jaz
 
Convoluted? I absolutely agree.

There is probably a way to use the count table from Excel.

That would get me around the dba not letting me create the count table.

When I get time, I think I'll go back and try to redesign my label report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top