I want to display elements horizontally (in one “line”). I’m imagining this problem like a table with one row and dynamic number of columns. Each cell in this table contains the same subreport but with different data source.
At the beginning I was trying combining a component list and the subreport. But it turned out that the list component doesn’t support a horizontal layout. I read somewhere to use the crosstab instead. But when I’m trying to insert the subreport into a measure cell iReport displays a message that I can’t do it. So what can I do?
Based on your above comment, I would say that it is not that difficult to print a list of elements horizontally. A List component is basically a subreport. So, you could also create a custom List component, which prints a list of elements horizontally. All you need is to create a new report without any margins, set it’s “Print Order” to “Horizontal” and set the number of columns as per your requirements. You could then embed this report as subreport in some main report and print elements horizontally.
Based on your requirements, you can set the report and text-field sizes accordingly. Here’s the screenshot for that report I created:
And here’s the sample jrxml document that I created: