I want to print a rather large table and would like to be able to:

1) span the columns of the table over several pages and
2) repeat curtain columns on every page

much like it is possible in spreadsheets.

One possible solution would be the following:

1) Aqquire the columns to be frozen and pages to span (from user, configuration file etc.)
2) Given the page width and number of pages to span - each columns relative width can be calculated (through physical page size and JTable's getColumnWidth() and some relative simple math)
3) Generate a XML-FO table for each page to span adding the frozen columns to each table (and of course the columns calculated to be on that page) and insert these tables in the XML-FO document.

F.x. if the table had rows for 2 pages and columns were to be spanned over 2 pages the above solution would generate 4 pages where the first page would be the tables "upper left" corner, the second page the "lower left" corner, the third page the "upper right" corner and finally the fourth page the "lower right" corner (table header and frozen columns being present on each).
In short the pages would be printed as (number is page number):

13
24
(upper left, lower left, upper right, lower right)

Now my questions are:
* Does any of you know any solution smarter than this that accomplishes the same ?
* Is it possibly using FOP (XML-FO) to create the above print where the pages are printed as follows:
12
34
(upper left, upper right, , lower left, lower right) ?

/Mikael

Reply via email to