Print Page | Close Window

Help combining like fields into a single one?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7767
Printed Date: 04 May 2024 at 10:49am


Topic: Help combining like fields into a single one?
Posted By: blue
Subject: Help combining like fields into a single one?
Date Posted: 22 Sep 2009 at 11:29am
Hi everyone, I'm a relative noob when it comes to Crystal Reports and writing formulas for it and such. Mostly I just use it for little tweaks, but maybe with some direction you can help me out with my current task.

On our invoices, for one reason or another, we can have multiple instances of the same product show up as separate line items with different quantities. What I would like the crystal report to do is identify if the same Product Code (a unique identifier to the product) shows up more than once, and if it does, combine all instances of that product into a single line item with the quantities added together as well.

Hopefully this isn't too difficult to do. Please let me know if this doesn't make sense and I can attempt to explain further.

Thanks in advance! Smile



Replies:
Posted By: jkwrpc
Date Posted: 22 Sep 2009 at 1:14pm
You should use a group. You go to the Insert-> Insert Group. That will insert a group on your report and will open a dialog asking you which field to group by which would be your Product Code field. T
 
There are a number of ways to sum the total but the easiest I believe will be for you to place the quantity field in the detail section. Right click on that field and select insert summary field. It will open a dialog box and select place summary in group footer.
 
If you dont want all the Quantity fields to show, move the blue section on the side of the report and right click on Detail section and choose suppress section. (You can also use the Section Expert for this.
 
What you end up with is
Group Hdr Product Code
Detail Quantity ( this wont show since its suppressed
Group Ftr Total of Quantity for that product code.
 
There are things you can do with placement like moving the Product Code field to the Group Footer if you want it to show on the same line as the summary  and so on.
 
Hope this helps
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net
 


Posted By: blue
Date Posted: 23 Sep 2009 at 4:14am
Thank you for your help John! I am going to try this out now and I'll report back on how it goes.



Print Page | Close Window