We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Repeated header rows do not work for nested tables

Hello!


I believe I found several issues with nested tables in aspose pdf.


Currently I try to create small demos of the issues. The second is the following:



<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">






Java2HTML: RepeatingHeaderRowIssue.java






1 package de.gad.gfw.web.print.pdf.issues;
2
3 import aspose.pdf.BorderInfo;
4 import aspose.pdf.BorderSide;
5 import aspose.pdf.Cell;
6 import aspose.pdf.ColumnAdjustmentType;
7 import aspose.pdf.MarginInfo;
8 import aspose.pdf.Pdf;
9 import aspose.pdf.Row;
10 import aspose.pdf.Section;
11 import aspose.pdf.Table;
12 import aspose.pdf.Text;
13
14 public class RepeatingHeaderRowIssue {
15 public static void main(String[] args) {
16
17 // issue 01: when using nested tables the borders of outer and inner
18 // table overlap
19 // issue 02: when using nested tables repeating header rows are not
20 // repeated
21 // issue 03: embedding fonts does not work on Windows XP and Mac OS x
22 // 10.6
23
24 // create a pdf
25 Pdf pdf = new Pdf();
26 Section sec = pdf.getSections().add();
27
28 // prepare a margin
29 MarginInfo margin = new MarginInfo();
30 margin.setLeft(5);
31 margin.setRight(5);
32 margin.setTop(5);
33 margin.setBottom(5);
34
35 // insert a bordered table with a margin of 5 points into the pdf..
36 Table outerTable = new Table(sec);
37 BorderInfo border = new BorderInfo(BorderSide.All.getValue(), 1.0f);
38 outerTable.setDefaultCellBorder(border);
39 outerTable.setDefaultCellPadding(margin);
40 sec.getParagraphs().add(outerTable);
41
42 // and insert a header row.
43 Row row = outerTable.getRows().add();
44 Cell cell = row.getCells().add();
45 cell.getParagraphs().add(new Text("header of outer table"));
46 outerTable.setRepeatingRows(1);
47
48 // insert another row with one cell
49 row = outerTable.getRows().add();
50 cell = row.getCells().add();
51
52 // Create a second bordered table with the same margin ...
53 Table innerTable = new Table(sec);
54 innerTable.setDefaultCellBorder(border);
55 innerTable.setDefaultCellPadding(margin);
56
57 // and insert it into the last cell of the outer table.
58 cell.getParagraphs().add(innerTable);
59
60 // Create a cell in the inner table put a dummy text into it and
61 // configure it as a header.
62 row = innerTable.getRows().add();
63 cell = row.getCells().add();
64 cell.getParagraphs().add(new Text("header"));
65 innerTable.setRepeatingRows(1);
66
67 // insert multiple rows in order to provoke page breaks
68 for (int i=0; i<50; i++) {
69 row = innerTable.getRows().add();
70 cell = row.getCells().add();
71 cell.getParagraphs().add(new Text("..."));
72 }
73
74 pdf.save("aspose.pdf");
75 }
76 }







The result looks like: image and image



I expected to see an outer and an inner table with one header row each. The header should be repeatet on every page but is only repeated for the outer table.



Best regards,
Juergen

Hello Juergen,

I have tested the scenario using Aspose.Pdf for Java 2.7.0 and as per my observations I am able to notice the first row repeat issue for inner table. For the sake of correction, I have logged this issue as PDFJAVA-21432.

Regarding the other formatting issue where table rows are placed over table border is logged as PDFJAVA-21435. We will further look into the details of both the issues and will keep you updated on the status of correction. We apologize for your inconvenience.

The issues you have found earlier (filed as 21432) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as 21435 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.