Skip to Content
0

Pivot table like table in report

Dec 06, 2017 at 03:27 PM

75

avatar image

Hi,

I have a record in tabular structure as shown in figure below on left side. I want two columns of first tabular data to display in multiple column as shown in right side of the figure.

I have other details too beside subject and date in table like RollNo, AdmissionNo but for clarity I have shown only these two since I need to transpose rows to column. How can I achieve this in crystal report. It seems I can not use Cross-Tab Report for this..

req.png (10.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Abhilash Kumar
Dec 06, 2017 at 05:25 PM
0

Hi Bhuban,

A Crosstab is your best bet at transposing data. Without a Crosstab you'd need to know exactly how many columns you'd need and then place static text fields - one for each Row value.

With a Crosstab, you'd use the Date field as the Column (Highlight date field > Group Options > Make sure it is set to print 'For Each Day')

The Subject field would then go as a Summary field with its Sum function set as 'Maximum'.

-Abhilash

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Abhilash,

Thanks. it is taking shape as I want but I don't want Column Grand Total column on the left side of report. I can't do Suppress Column Grand Total on Cross Tab Expert Customize Style because doing so will not print subject. I only need to suppress Total column on the left side. How can I do this? Other than this report looks good.

And also is there way to make cross tab table to fill the page I mean it should start from left up to the right most corner leaving margin. Right now it takes only required width but I want that table to take space from left to the right leaving only margin on paper.

0
Abhilash Kumar
Dec 07, 2017 at 08:34 AM
0

Hi Bhuban,

Right-click one of the cells in the 'Total' Summary > Format Field > Common tab > Check Suppress.

Do this for the 'Total' label as well. Then reduce the width of the Total Label and Summary cells. You cannot unfortunately get rid of the Gridlines in that Total Column.

Also, to take up all of the available page width, you'd need to 'manually' increase the crosstab cell widths.

-Abhilash

Share
10 |10000 characters needed characters left characters exceeded
Dell Stinnett-Christy Dec 07, 2017 at 06:54 PM
0

Working with a cross-tab may be possible, like Abhilash states. However, there may also be a way to do this in a Command (SQL Select statement) to bring the data into the report in the format that you need. A lot of that depends on the database and the total number of fields that you need to display. For example, MS SQL has a "Pivot" clause that could be used for this and I've been able to manually pivot data in queries as well.

-Dell

Share
10 |10000 characters needed characters left characters exceeded