Saad Farooq
Saad Farooq

Reputation: 997

Display Some Rows as Columns in Crystal Report

I would like to create a report that has the following Format:

ID-1    |Name           |Subject 1|Subject 2|Subject 3|Subject 4|
ID-2    |Father Name    |Marks 1  |Marks 2  |Marks 3  |Marks 4  |

The data that is returned in the dataset is of the format:

ID-1|ID-2|Name|FatherName|Subject 1|Marks 1|etc|Etc|
ID-1|ID-2|Name|FatherName|Subject 2|Marks 2|etc|Etc|
ID-1|ID-2|Name|FatherName|Subject 3|Marks 3|etc|Etc|

I tried using Crosstab but I wasn't able to acheive the required output. An hint on how to accomplish it ? AND/OR what Crystal Report Feature|Control will help me achieve it ?

In a more sumamrized way, What I would like to do is to Show the Marks of the Subjects that are returned as multiple rows in a single row and display the similar data in each tow i.e. the ID-1, ID-2, Name. Father Name etc. just once ! (Note: The Data needs to be shown in 2 lines per Student as shown in the example.

Upvotes: 2

Views: 2875

Answers (1)

MYK
MYK

Reputation: 845

By using pivot you can easily convert rows to column. Check this pivot example on sqlfiddle for your problem.

Upvotes: 3

Related Questions