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

printing a user-defined number of labels 1

Status
Not open for further replies.

flailcozy

Technical User
Dec 4, 2007
18
US
I have a report that prints out a label for each sample on a sample submission form. I created a parameter where the user is asked how many copies of each sample label they would like to print (this number could potentially be different each time a report is printed). I created a table, LABEL_COPY_NBR, with a single number field, and inserted 100 records, populating the field with the numbers 1 to 100 (assuming 100 would be the maximium number of copies requested).

My question is, since the number of copies is user-entered, I don't know how to hook up the LABEL_COPY_NBR table to the others, or even use it to get the number of repeats I want. I spent a while searching the Crystal forums, and all other references to this topic that I found have the number of labels based on a field in another report table.

Assume that the current report contains the LABEL_COPY_NBR table, a SUBMISSION_FORM table, and a SUBMISSION_SAMPLE table; that the childmost table is the SUBMISSION_SAMPLE table; and that SUBMISSION_FORM.order_id=SUBMISSION_SAMPLE.order_id.

The report has no groups, just a few fields in the Details section of the report. Also, the labels print 7 across, so I can't use conditional supressing of sections, unfortunately.

I would appreciate any and all suggestions--this has been on my to-do list for quite a while!

thanks :)

jc
 
Hi,
Ignore the LABEL_COPY_NBR table.
Try:

Create a parameter that the user uses to specify the # of labels needed.

Use that parameter to limit the # of records ( and therefore, I assume, labels, returned ( use a Selection formula something like Record_Number <= [?Parameter#])



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear--

Thanks for the suggestion. Unfortunately, I am trying to increase, rather than limit, the number of records that are returned. The way the data model is set up, only one record per sample is retrieved, and therefore printed on the report. I created the LABEL_COPY_NBR table to try and trick the database into returning more records than exist per sample. I just can't figure out how to hook this up to the existing tables to accomplish this.

jc
 
Hi,

Try this:

Add the LABEL_COPY_NBR table to the report, no link to other tables. In the record selection formula of the report add:
?NrOfLabels >= LABEL_COPY_NBR.number_field

Dana
 
Hi Dana-

That worked perfectly--thanks so much! :)

--jc
 
Great solution--I fooled around with this for a long time, without success (*).

-LB
 
Hi,

The original idea with the repeater table is from Ido Millet.
What Turkbear sugests, also works when writing your own SQL command. I use this when I have this kind of reports.
So, add another table (any table) to the query, without linking, and add in the WHERE clause the condition (for ORACLE): ROWNUM <= number_field or, if the number of labels is given by the user: ROWNUM <= ?NrOfLabels

Dana
 
Hi,
I was directed to this thread (thanks lbass!)and I'm having an issue.I added an xls file (Label_Copy_Nbr)with a column of numbers (1-20).
My record selection formula looks like this
{Sheet1_.F1} >= {?NumberOfLabels}.
If I enter 5, I get two pages of six (created label using wizard for our standard Avery label)and one page of four for a total of 16.
Any help would be appreciated.

Skip
 
You have the selection formula backwards. Should be:

{?NumberOfLabels} >= {Sheet1_.F1}

-LB
 
Oops!
OK, I flipped it but now it gives me one less than what I request (Ask for six, get five)

Skip
 
I can't recreate that issue. Maybe try going to database->check "select distinct records".

-LB
 
Thanks for the help lbass. It's close enough for now. I will post the solution if I find it.

 
It works for me as is. Make sure you have used the correct sign >=.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top