Thornn Posted June 21, 2013 Share Posted June 21, 2013 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 2011data1 data2 data3anotherdata1 anotherdata2 anotherdata3 and i want:HeaderForYear 2013 2012 2011HearderForData data1 data2 data3HeaderforAnotherData anotherdata1 anotherdata2 anotherdata3I 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. Link to comment Share on other sites More sharing options...
Thomas Zimmer Posted June 22, 2013 Share Posted June 22, 2013 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, Thomashttp://www.thomaszimmer.netP.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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now