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

Displaying Selected Fields 1

Status
Not open for further replies.

TymArtist

Programmer
Jan 24, 2006
9
US
Hey guys, I'm new to the forums and hope to learn a lot and eventually start helping people out. My knowledge of Crystal is fairly limited but they've had me working with all our reports, pretty much just Sales Order's, Invoice's, etc. The current issue is with a Packing Slip.

I had to set it so that in the detail line, it prints a Description, a Serial Number, and a Quantity. The Description is just the name of the product, and then the serial number for that given product. However, each time it prints a serial number, it prints the product name and the total quantity. So if a client has ordered three of a given product, it would list:
"Widget" "Barcode" "5"
"Widget" "Barcode2" "5"
"Widget" "Barcode3" "5"

Is there a way to suppress the Description and Quantity if there are more than one, so it would just list the barcode on the second and third line? Sorry for the probably basic question, but I'm still hacking my way through learning Crystal.

Thanks in advance!
 
Which Crystal? In Crystal 10, right-click, choose [Format Field] and then choose [Suppress if duplicated]. In 8.5, you'd need to go to the suppression formula and enter Quantity = Previous(Quantity) etc.

You should probably also be grouping by client and widget, which allows for easy totalling and relevant details in the header or footer.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Wow thanks, I'm shocked at how easy these solutions are some times. Next time I'll try searching through the FAQs rather than posting here first (duh).

Anyway, I'll research the grouping idea a little bit. I've dealt with it before but obviously it still goes over my head somewhat :)
 
This worked well, except now if there are two products on the page and a quantity of zero has already shown for the first product description, then it will not show it again. I was attempting to suppress the quantity only if the description = "" but that didn't seem to work. Is there a way I can check to see if the description is being suppressed, and if it is suppress related fields, and if not then show them?
 
On the same page as [Suppress if duplicated] there is a suppression formula that can be made conditional.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
I attempted to use this conditinal before but is there a formula to tell if something has been suppressed or not? field.description = "" doesn't work.
 
Create a formula {@concat} that concatenates the two fields you want conditionally suppressed:

{table.description} + totext({table.quantity},0,"")

Then select each of the two fields->format field->suppress-if duplicated ->x+2 and enter:

{@concat}= previous({@concat})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top