Hello
I am quite new to SQL and CR but managing (to date) but have come across an issue caused by the structure of a table in which I need to generate a report. I am using CR through Visual Studio 2010. I am building a report that calls on a Table that has 4 columns (for ease I have named them C1 to C4)
So:
C1 = Identfies the unique object (Identifies the object within the group - See C4)
C2 = is the ID (3 digit code from 001 to 999) of the the field
C3 = Is the value related to the field (C2)
C4 = Is the document ID (5 digits) to which all the information is assigned
The problem I have is that the table is structred vertically so that for the same document (C4) you can have the same C2, C1 (and C3) so for example
C1 C2 C3 C4
10000 138 Good 23456
10000 159 New 23456
10000 222 22/06/2011 23456
10022 138 BAD 23456
10022 159 USED 23456
10022 222 29/08/2011 23456
So my issue is how can I convert the vertical format of the data and make it horizontal so it appears in the Crystal Report as
C1 C2_VALUE(138) C2_VALUE(159) C3_VALUE(222) C4
10000 Good NEW 22/06/2011 23456
10022 Bad USED 29/08/2011 23456
I know I have to use the Command function in CR but I really am having an issue getting the code to work so I can extract and layout the data as shown
Any suggestions would be greatly appreciated.
Thank you
Dan
I am quite new to SQL and CR but managing (to date) but have come across an issue caused by the structure of a table in which I need to generate a report. I am using CR through Visual Studio 2010. I am building a report that calls on a Table that has 4 columns (for ease I have named them C1 to C4)
So:
C1 = Identfies the unique object (Identifies the object within the group - See C4)
C2 = is the ID (3 digit code from 001 to 999) of the the field
C3 = Is the value related to the field (C2)
C4 = Is the document ID (5 digits) to which all the information is assigned
The problem I have is that the table is structred vertically so that for the same document (C4) you can have the same C2, C1 (and C3) so for example
C1 C2 C3 C4
10000 138 Good 23456
10000 159 New 23456
10000 222 22/06/2011 23456
10022 138 BAD 23456
10022 159 USED 23456
10022 222 29/08/2011 23456
So my issue is how can I convert the vertical format of the data and make it horizontal so it appears in the Crystal Report as
C1 C2_VALUE(138) C2_VALUE(159) C3_VALUE(222) C4
10000 Good NEW 22/06/2011 23456
10022 Bad USED 29/08/2011 23456
I know I have to use the Command function in CR but I really am having an issue getting the code to work so I can extract and layout the data as shown
Any suggestions would be greatly appreciated.
Thank you
Dan