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 can I print x times the same field? 1

Status
Not open for further replies.

chuito7

Technical User
Jan 5, 2005
26
0
0
US
Hi:

I'm trying to make a report that prints the same amount of lines or boxes of the quantity to pick. For example I got a line like this:

ITEM NO DESCRIPTION U/M QTY
100XLG ITEM 1 CASE 4

______ _______ ________ ________

So the picker at the warehouse can write down the exact weight of each product.

I think that with a for 1 to n I could achive this but I don't know the syntax.

Thanks.

Jesus M. Cruz Narvaez
Senior IT Consultant
JT Consulting Group, Inc.
jesus@jtconsulting.com
 
So you want to print the same line 4 times in this case? And if the next had a qty of 11 you would want to print it 11 times?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
YES.

Jesus M. Cruz Narvaez
Senior IT Consultant
JT Consulting Group, Inc.
jesus@jtconsulting.com
 
Find or create a table with the numbers 1 thru 500 in it (or whatever is a reasonable maximum # of records to print). Link this table to your qty field using a not equal to join. Place the number from the new table on the report, suppress it if you do not want it to show.

At this point, you will have 499 records, as 400 of the 500 records do not equal 4.

Te conditionally suppress the records based on the recordnumber >4.

If you have groups, the approach is similar, but you'll need to create a running total count field, reset by group, and suppress based on the running total field.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
There is also an faq by Ido Millet on this topic: faq767-3227.

-LB
 
Your answers are right, but I'm trying to repeat the same field x times. Not the whole record. The situation is this, this is for a picking ticket. The quantity is 4. I have to print 4 lines vertically like this ( ______ ______ ______ ______) if the quantity is 3 I have to print 3 lines vertically like this: (_______ _______ ______), so the picker can write down the weight of each box. I'm using a For x to y approach and it seems to work, but it is a lot of code. If there is something simplier would be great.

Thanks.

Jesus M. Cruz Narvaez
Senior IT Consultant
JT Consulting Group, Inc.
jesus@jtconsulting.com
 
This is the approach I was testing. Ir works for the first 18 lines (Crystal 8.5) has a limitation with string fields to 254 characters, I have to break it each 18 lines.

Code:
WhilePrintingRecords;
stringvar x;
stringvar y;
numbervar nCounter;

IF {@qty} <= 18 THEN
For nCounter := 1 to {@qty} Step 1 Do
x := x + "________" + "     ";


IF {@qty} > 18 AND {@qty} <=36 THEN
For nCounter := 1 to 18 Step 1 Do
x := x + "________" + "     "
  ;
For nCounter := 19 to ({@qty}-18) Step 1 Do
y := y + "________" + "     ";

Jesus M. Cruz Narvaez
Senior IT Consultant
JT Consulting Group, Inc.
jesus@jtconsulting.com
 
If you can upgrade to version XI or newer the 254 characters is now 64,000.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Heres a better idea:

ReplicateString("______ ",{YourQtyField})

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
It worked real good!!!! I'll appreciate your help. About the 254 characters limitation I do something to workaround this.

Thanks again!!!

Jesus M. Cruz Narvaez
Senior IT Consultant
JT Consulting Group, Inc.
jesus@jtconsulting.com
 
If you use the FAQ mentioned above, all you need to do is group on Order ID and let the detail section take care of displaying what you need for each box.

- Ido

view, email, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top