About displaying colum header horinzontally

0

Hi all,

I want display some data horizontally, so i found the print order property. It's work, but i can't display the header without repeating it for each column.

I have something like that:

2013                  2012                  2011

data1                 data2                 data3

anotherdata1   anotherdata2   anotherdata3

 

and i want:

HeaderForYear                 2013                  2012                  2011

HearderForData               data1                 data2                 data3

HeaderforAnotherData   anotherdata1   anotherdata2   anotherdata3

I see on old topics that i have to use a crosstab, but i dont really understand how (i don't want to make some avg, sum, etc. just display my datas and their headers).

How can i do this ?

(I'm using ireport 4.5.0)

Thx.

Thornn's picture
2
Joined: Jun 6 2013 - 3:01am
Last seen: 6 years 4 months ago

1 Answer:

0

You don´t need to use column or row totals of a crosstab (deselect). Simply set the column with Header... as row group, the year column as column group, and the data you want to display as measure. Then the crosstab should nearly exactly show what you want.

For general, IMHO a multi-column layout of a jasperreport is NOT intended to build a table-layout output. It´s more to show up data in a daily newspaper stype. However, if you know your data exactly,  you could manipulate your dataset to have the headers as data; then have 3 records (headers) in the first column, one year and two data records in the next column, and so on. But I cannot imagine that´s a good approach.

Cheers, Thomas

http://www.thomaszimmer.net

P.S.: And if it´s your intention to have a report with four columns and only three static years, don´t use a column layout at all; simply get records with all the information for the three years in it and design a one column report with all tehe information in a single detail band. Crosstabs are only good, if you want to show data in a variable amount of columns.

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 5 days 13 hours ago
Feedback
randomness