using HSSF and POI with Java

I

ipy2006

Need to create a spreadsheet report with 15 columns and over 2000 rows
or more. The report has to be sorted by the first 5 columns (nested
sorting). Also at each level weight averages need to be calculated.
How would you handle this? Would you build a data structure or DTO,
data transfer object, or use something like TreeMap, ArraList,
HashMap combination, over the 5 levels? Please comment. The data is
being read from the database.
Thanks,
yip
 
I

ipy2006

Thanks, but more importantly as I read the data from DB, do I create a
special data transfer object for my needs or do I used nested,
HashMap, ArrayList, HashMap combination over 5 levels? Please comment.
I am looking for getting the data into the Spreadsheet of JTable
elegantly?
Thanks,
Yip
 
R

RedGrittyBrick

ipy2006 wrote:

Please don't top-post!
Please don't quote signatures!
Thanks, but more importantly as I read the data from DB, do I create
a special data transfer object for my needs or do I used nested,
HashMap, ArrayList, HashMap combination over 5 levels? Please
comment. I am looking for getting the data into the Spreadsheet of
JTable elegantly? Thanks, Yip


I usually read from DB into a subclass of AbstractTableModel.

Sorting can be handled separately although it may be best to do it in
the SQL if you have appropriate indexes in the database.

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting

"Here is an example that sorts the table used in the examples by the
first two columns. ..."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top