@bchetty: Sorry I decided to respond, not comment, because I don't have enough reputation to do this. The solution you submitted works fine, but leaves the layout of the report pretty Ok. I had a familiar requirement when I saved the size of the columns as 20, but then I can never predict that it will not cross 20 in some query. Again, if only three values are retrieved from the query for columns, the remaining column spaces remain empty and do not provide a good layout for the generated report.
I read in iReport the final reference that if List is used as an auxiliary report and printOrder is “horizontal”, we can get the effect of dynamic columns. But I believe that this is just an “effect” and not dynamic columns, since the size of the columns should be fixed at a value greater than 1.
I am at the end trying to achieve this, but I think I may have to refuse. Crosstab cannot come to the rescue as it is limited to two row groups and two column groups. But there are other fields in the report that should also be printed along with dynamic columns. Print horizontal sub-report data
source share