Print Page | Close Window

Converting rows to columns

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
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=13161
Printed Date: 05 May 2025 at 8:17am


Topic: Converting rows to columns
Posted By: Erinmichelle
Subject: Converting rows to columns
Date Posted: 10 May 2011 at 10:31am
Hello,

I have a table that is set up funky.  I really need one of the set of values (currently in one column) to be the column headers.  Here is a sample of my data:

ID           pq_li   dt_li    detail_value
12279    553      1              79
12280    553      2              TABLET
12281    553      3              P 97910
12282    553      4              6109101034
12311    554      1              80
12312    554      2              TABLET
12313    554      3              P 98457
12314    554      4              6109101034
12377    556      1              82
12378    556      2              TABLET CHEWABLE
12379    556      3              P 97933
12380    556      4              6109099195

As you can see, for each unique value in pq_li, there are four different detail_values which are each categorized by dt_li.  What I really want is to have the headings of: ID, pq_li, 1, 2, 3, 4, detail_value so that there is only one row for each pq_li value.  How can I make this appear in Crystal? Your help is appreciated!


-------------
Thanks!

Erin



Replies:
Posted By: lockwelle
Date Posted: 16 May 2011 at 3:56am
well, create shared variables for each value you want in the row.
in the detail section of the report, place the values into the appropriate shared variable.  Once you are comfortable that the values are being updated correctly, suppress the detail section. 
 
Create accessor formulas to view the shared variables and place them as desired in the group footer, viola, the rows have been pivoted.
 
You may want to reset the variables in the group header in case a value is missing.
 
HTH



Print Page | Close Window