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!

A pick list.

Status
Not open for further replies.

Kghaun

Programmer
Oct 24, 2018
4
US
Hi all I am trying to create a report that shows an order. The database structure is not exactly how i would like it so here is my challenge.

I bring the purchaser info at the top.

Now I want all the items and qty. ordered.

The problem is I only want to show when there is an order not when the record shows 0, further I want it to fill from top to bottom. No blank lines between.
When i print the pick list through the program I can use a procedure and variable to fill the list. Something like If variable = 3 then fill line 3 and 4. (Extremely shorthanded)
However in crystal if I use a formula with an if statement to display the correct table.fieldname I cant figure out who to set the variable up a number so i can use the next formula to set the position for the next item not 0. I am fairly new to this so please forgive me if I confusing. Thanks for any help.

-Kyle
 
A first step would be to create a selection formula like this (report->selection formula->records):

{table.qtyordered}<>0

-LB
 
Hey lbass,

The way the table is set up that would return one product when multiple may have been purchased.
Examply table columns
Cust. Name
Cust. Number
Send Date
Item 1 description
Item 1 QTY
Item 2 description
Item 2 QTY
Item 3 description
Item 3 QTy
Item 4 description
Item 4 Qty

Say the customer only ordered items 1 and 4.
I want crystal to show me

Jim
123456
abc brochure QTY 10
vdf

Not

Jim
123456
Item 1 Description Qty 10
// Blank line
//Blank line
Item 4 Description Qty 10



Hope this is slightly more clear.

-Kyle









 
It looks like you are saying there are separate fields for each item and its corresponding quantity. Is that correct?

I don’t understand what you are showing in your example if item 4 = vdf, why aren’t you showing the quantity?

You should really change your database so that there is one item field, one description field, and one quantity field. Otherwise, you could accomplish the equivalent by doing a union all commmand to combine them into one field each. This would work easily if you only have four fields, but I’m wondering whether you might have thousands?

-LB
 
You are correct. There are too many fields. I do not like this structure and believe it is incorrect. However, I am a small fish in this pond so for now I cannot change it. I meant to show the qty for item for also. I just forgot to put it in there. I was using vdf as a "description" I got sidetracked while typing it. I may have figured out how to do this in crystal also will know tomorrow. Currently for this report it is only dealing with 14 items so its rather small for the time being.



-kyle
 
Well, with just 14 items, you could insert 14 detail sections, one for each item. Then conditionally suppress each section with:

{item#.qty}=0

Also format each section to “suppress blank section”.

-LB
 
Would that not create blank space between lines if item 1 and item 14 were the only ones to order?
 
Not if you take the two steps in my last post to conditionally suppress if = 0 and to suppress blank section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top