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.
1 Answer:
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.