Jump to content
Changes to the Jaspersoft community edition download ×

About displaying colum header horinzontally


Recommended Posts

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)


Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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


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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...