A data source suitable for use with JasperReports.
This is basically just an extension to
Query that allows the
results to be iterated over, thereby providing the ability for objects to be reported on
that are held in memory.
One limitation here is that the SQL query must return columns rather than the objects
since the values need to be mapped by JasperReports. For example:
SELECT lastModified,
name
FROM java.io.File
WHERE name LIKE '%.html'
This query would work but it should be noted that the select "columns" (since they do not have
aliases assigned) will be labeled 1, 2, X and so on.
You can assign aliases to the "columns" and then use them in the report definition file.
Please note: due to my bewilderment (and the fact that I can't get the examples to work ;)
I haven't been able to adequately test this implementation, in the rudementary tests I
performed it seemed to work. If it doesn't please send me an example so that I can try
it!
|