Automatic PageBreak on large table breaks table formatting

Hi,

We've been using aspose.pdf to display cube data in one of our applications. We've had problems with a rowspan bug from an earlier version of the application, but after having received some new code (3.0.3.0) and rewriting ours (which was geared towards working around the problem) we've been able to remove that specific problem.

However, now I have come across something that might be an issue with this version using large nested tables.

In the provided example We have put a table with 2 rows with 2 cells in each row into a section.

The top left cell is simply a cell containing a whitespace, formatted not to have any borders. The top right cell contains a table (columnHeaderTable) which in itself contains cells displaying our column header captions (where some cells use ColumnsSpan to "merge" supercategories).

The bottom left cell contains a table of rowheaders (rowHeaderTable) using RowSpan to span several rows where applicable. The bottom right cell contains a table with actual cube data (all cells having RowSpan/ColumnsSpan of 1).

The problem we are experiencing is that the rowHeaderTable is broken strangely, lines running to the absolute bottom of the page (in spite of page margins) while the data table continues displaying cells without experiencing a break in the same location, which causes misalignment of the two tables containing row headers and cube data. Also, when trying to left align the table the parts of the table that end up on new pages are centered for some reason (this might be a default settings thing where a new page is handled as a new section or paragraph in a way that requires us to alter the default alignment values. It is of lesser importance right now).

The problem occurs for unknown reasons. For some smaller tables using rowspan in the same manner (where the rowHeaderTable contains two columns and the maximum rowspan is two) pagebreak is handled correctly. What we have noticed is that when the rowspan is rather large near the end of the page and we have three columns of rowHeaderTable cells the table formatting is broken.

Unfortunately, since we are using recursion on cube data with rather complex and integrated code it is difficult to provide a working example using our code. I am pretty sure you could create a table with similar properties and experience the same issues though. What I can tell you is that at the point where the problem occurs the rowspan data appears correct. For instance, in the file "cd91b4c4-737e-4abd-8322-1bb6ec2a7171.pdf" rowHeaderTable.Rows(42) The cell count is as it should be (4) and rowspan values for the cells are also correct (42, 21, 3, 1 respektively.

Would greatly appreciate any help you could give us as we are pretty pressed for time.

Hi,

Thank you for considering Aspose.

Please check again with latest version of Aspose.Pdf.

Thanks.

Unfortunately our current license doesn’t alow us to use the latest version. I was going to try out the evaluation version to see if the latest dll fixes our problem, but I can’t for the life of me find an evaluation license on your site.

The aspose purchase page(Pricing - Purchase - aspose.com) has an image which explains there are evaluation versions and has the text “download now”, but I can’t find a download link anywhere on the page and the image itself does not have an onclick event.

If you could direct me to the location of a downloadable evaluation license I would be happy to try the new code.

Hi,

Please refer to the following URL and press the download button. Install the latest version and add that dll in your project, recompile and run the project again. Remove the statement to set the license and it will work.

Free Support Forum - aspose.com

Thanks.




That did indeed work. Unfortunately, it did nothing to solve my problem.

What I would like to accomplish is:

To have an empty first cell (whitespace content to avoid colapsing) on the first row in a parent table. (space between column and row header tables).

To have the columnHeaderTable in the second cell of the first row of the parent table (this to easily enable alignment with the other tables and to automatically receive a repeat of the columnHeaders when requesting that the table repeats the first row on page break.

To have the rowHeaderTable in the parent table cell below the empty first cell (Row index 1, cell index 0). This Table should manage to have rows that span over the page break and still somehow remains intact on the next page without breaking the table.

Alternately, causes a break before the gigant rowspan cell putting the rowspanned row and all its successors on the next page while also telling the parent table that no other content should pass this point. For instance, creating a pagebreak in the rowHeaderColumn should make the cellContentTable (which I have placed to the right at parent table row index 1, cell index 1) stop its rendering of rows and continue those on the next page (because I want the left table synhcronized with the right one). The big problem with this sollution is that I have implemented code which creates columns that do not fit on the page widthwise in subsequent sections (and thus at subsequent pages). If for some reason I would not want the rowHeaderTable to be visible on all pages spanning to the "right" of the first widthpage (quite probable since the table may take up lots of space) I would have no way of knowing where the original table had its page break.

Ideally, I want the table to reach the absolute end (or as close as you can get with a certain row height) of the page before introducing a page break (so that any other rendering with an equal rowHeight per cell with just as many rows would break in exactly the same place).

By setting the parent table and all subtales to allow isbroken and setting the subtables to isRowBroken to false while having the parent table isRowBroken remaining at true I can accomplish the rowHeaderTable to break before any row spanning. The problem with this sollution is that the cellContentTable (again, subtable in the parent tables row1, cell1) continues to render rows as they are smaller (only rowspan=1). Also, I have no way of knowing how to induce page breaks in the correct place when rendering columns that did not fit the width of the first page in another section (I want to be able to put printed version of a table with two page heights for of rows and two pages worth of column width in a square of 4 A4 pages (2x2) and have all rows on the same height). Also, in some simple cases, when the table normally breaks correctly (where I only use rows with rowspan=1 and only one column of columnheaders and one column of cellDataTable) the last cell of on the page loses its formatting and possibly its cell content.

Is there no way around this mound of issues? Am I better off trying to ignore any automatic features and nested tables and just try to implement a functioning table renderer using a single table with offsets (for rendering of headers and cube data), separate cell font settings, height calculations and separate section rendering of tables that would normally span the bottom end of a page to avoid having to deal with the automatic feature? the problem is my code is complicated enough with performing temporary merges of columns to check width and use separate section for displaying tables that are too wide for me to want to do this. Would love it if I could get good results from a commercial product instead so that our, not very complicated, requirements could be met without having to create my own table rendering engine.

Attached example where we are using isBroken and isRowBroken on the parent table and all subtables.

Attached example where we have set isRowBroken on all subtables to False

Hi,

It is difficult to create it as it is, but I will try to check in detail this problem.

Thanks.