DynamicJasper is an open source
Java API that works over JasperReports that solves the dynamic columns issue.
It is very well
documented with lots of
examples.
Here you have an example
and this is the results
As you can see, you can also define groups, styles, etc...
Some of its features are:
Features
Most of the features are provided directly by Jasper Reports, but through the DJ API, some of the results are achieved with much less effort.
Dynamic column report Columns can be defined at runtime, which means you also control (at runtime) the column positioning, witdh, title, etc.
Repeating groups, Breaking groups You can create repeating groups dynamically using simple expressions as criteria or complex custom expressions.
Each repeating group may have a header and/or footer, which can have a variable showing the result of and operation (SUM, COUNT or any other provided by Jasper Reports).
Dynamic Crosstabs JasperReport's popular crostabs can now be created dynamically in a ver easy and convinient way.
Sub reports Sub reports are supported, they can also be dynamically created.
Concatenating many reports in a single one (eg: a single PDF) can be a hard task.
Using DynamicJasper it is really easy get reports of different nature in a single one.
Elemnt styles Each column can have its own style for its title and detail data (defining border, border color, font size, type and color, background color, etc.)
Variables As told before, repeating groups can have variables that hold the result of and operation on a given field (column).
Calculated Columns The DJ API provides a very friendly way to create calculated columns, this columns may shown the result of an operation between one, two or more columns. I.e.: for some reason the data source does not provide a column that should contain the result of �column A * column B�, you can create a calculated column to solve this problem.
The operation can also be a custom operation (created in Java) that can�t (for example) concatenate or more columns, transform it contents, etc.
Conditional Format DJ provides a very simple way to define conditional formats. You can use simple conditions or custom conditions.
Exporting to most popular formats As DJ stands over Jasper Reports, the output formats will be any given by the latter, but one of the most valuable features that DJ provides is exporting plain reports to excel, with no data formatting, no page break, etc. This is very valuable for end users that use this report to create dynamic tables in Excel, creating this reports just with Jasper Reports can demand a lot of design time.
Many more� Don�t stop looking at the ready-to-run examples
Regards
Hugo
[ July 03, 2008: Message edited by: Hugo Balmaceda ]