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

Show data based on the number of quantities

Status
Not open for further replies.
Dec 18, 2006
69
US
Hi all,

I am not sure I could come up with a better subject for this. It's a little bit confusing and I hope you all can help me.

I am using Crystal 2008.
I have an order with 2 line items. Item #1 was entered with qty ordered 2 and item #2 was entered with qty ordered of 1. What I need is to have the report to print the following:

Item #1
Qty 1 of 2

Item #1
Qty 2 of 2

Item #2
Qty 1 of 1

At this time, my database only has the qty ordered information. I am not sure how I can split my item to print based on how many quantities that are in my quantity ordered. At the end I'm trying to print labels for each of those items.

Any advice is greatly appreciated.

Thanks,

TTL101
 
i do not have crystal in front of me so cannot test, but think that something like below is what you are needing.
You will need to have groups on Item_id and possibly Formula1
I apologize in advance for any typos / mistakes.


\\{@formula1} \\place in details section
numbervar qo := {table.qty_ordered};
numbervar cnt;
IF cnt < qo then cnt := cnt + 1 else cnt := cnt;
If (cnt < qo OR cnt = qo) then {table.item_id} & chr(13) & "Qty " & cnt & "of " & {table.qty_ordered} else ""


\\{@formula2} \\resets cnt to zero -- place in item_id group header
numbervar cnt := 0;

 
There is an faq on this topic: faq767-3227.

-LB
 
Thank you both.
That certainly will work. The only thing I need to do is to convince my audience to not have the quantity ordered 1000 or 10000 or that table would need to be created as a large one.

Thanks again.

TTL101
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top