Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Sort by data from different columns Post Reply Post New Topic
Author Message
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Topic: Sort by data from different columns
     Posted: 30 Oct 2015 at 7:31am
I am using Crystal Reports 2011.

I have a database table that contains all the components used and the quantities used to create a finished part.  Each component and its corresponding quantity is in a different column based on type (for example: PolyType, PolyTypeAmt,  IsoType, IsoTypeAmt, CatalystType, CatalystTypeAmt, ColorType, ColorTypeAmt, etc.)

I need to create a report that extracts each component and its quantity from the table then sorts all the components alphabetically while keeping their quantity lined up.

Can this be accomplished?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 30 Oct 2015 at 8:32am
Yes, but not by joining tables together in the report. How are your SQL Skills? You'll need to write a Command, which is a SQL Select statement, that will do a union query pulling the finished part information, one type of component and its corresponding quantity in each select of the union.

There are a few things to be aware of when using commands to get them to work correctly, though. See my blog post for more information: http://scn.sap.com/community/crystal-reports/blog/2015/04/01/best-practices-when-using-commands-with-crystal-reports

-Dell
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Posted: 02 Nov 2015 at 3:13am
Hilfy,

Thank you.  I will try this.  If I am unsuccessful, Production will just live with the components being listed in what ever order I place their fields on the report.  There are not that many components to each part so it's not like there will be a large list they will have to look through.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum