Skip to Content
avatar image
Former Member

How to convert column data into row data in crystal report?

Hi,

Your help is very much appreciated.

I have a report with 3 colmns as follows,

User id Description LVL

Test1 Menu1 2

Test1 Menu2 4

Test1 Menu3 5

Test2 Menu1 3

Test2 Menu2 2 .......

I want the above data ib the following format,

User id | Menu1 | Menu2| Menu3

Test1 | 2 | 4 | 5

Test2 | 3 | 2|

How can this be achieved in crystal report?

Please let me know the solution if you can find one.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 22, 2009 at 06:49 PM

    Try inserting a group on the field Test1 and create a formula like this

    whileprintingrecords;

    stringvar Menu:="";

    Place this in group header and create another formula like

    whileprintingrecords;

    stringvar Menu;

    Menu:=Menu{menu field}" | ";

    Place this in detail section and create another formula like

    whileprintingrecords;

    stringvar Menu;

    Place this formula in group footer and also place the UserId in group footer

    Repeat the same steps for getting the numbers as well. You can suppress the detail section and group header.

    Regards,

    Raghavendra

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Raghvendra,

      I was able to follow your steps. But My Description and LVL Columns are not changed into rows.

      Data in the DESCRIPTION & LVL Table should be displayed as,

      One Menu Fund Menu Chat Menu Menu

      Batali 3 2 2 2

      Anne 2 7 2 3

  • avatar image
    Former Member
    Jan 22, 2009 at 05:00 PM

    kiran are you using crosstab?

    what are you using and what version of CR?

    Regards

    Jehanzeb

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Thank you for a quick reply.

      I have tried Cross Tab. But it does not work. I have 2 columns (Description, LVL) which needs to be changed to Row.

      Is there any other way we can achieve this? Kindly let me know.

      Thanks