Sorry - those classes that you have questions about are classes that I wrote. As I said, you will need to modify that code to suit
your needs. Basically, aData contains information on how to run a report, HashToArraySorter convertes between an array and a Map, and aValue is a generic Value that will hold any type of data (any primitive or Object). What
you should do is use that code as a template for your code, not as the actual code itself.
What Ilja said is accurate: what you want to do is first build the report to report of a database/JRDataSource/whatever (I personally use iReport to do this), compile the report into a .jasper file.
Then in your application you should load that .jasper file and pass it any paramters as needed (use the above code as a template on how to do that).
Finally, print the report.
Judging from what you want to do with allowing different users to see different columns on the report, you have three options. IN terms of least complex to most complex, they are:
1). Create different reports for different users. Use application-level security to control which report which user can run.
2). Create 1 report that takes as a parameter the security level. That report then can have logic that suppresses columns based on that security level.
3). Dynamically build a report. This is not recommended, as it can be quite complex. The simple way to do this is to build the report as XML, compile the report into a .jasper file, run the report, and then (optionally) delete that .jasper file. There may be a more complex way through the Jasper API (I know that this functionality exists in Crystal Reports' C API, although Crystal is not overly Java-friendly), but I do not know of it.
At any rate, this is not really a question relating to a SUN-provided API, so I'm moving this to our
Other Open Source Projects forum.
[ December 23, 2003: Message edited by: Joel McNary ]