目前我正在使用 Java 中的 Aspose Words 导出报告。我正在用动态数据填充表格,但我的主要问题是当数据到达下一页时,导出的文档中没有标题。如何获取导出文件中所有页面的标题。任何建议将不胜感激。
问问题
1056 次
2 回答
1
我们可以通过以下方式在JAVA中解决这个问题:
1.加载文件
Document doc = new Document(getMyDir() + "Table.SimpleTable.doc");
2.获取第一张桌子
Table table = doc.getChild(NodeType.TABLE, 0, true); //i.e. second parenthesis as index of table in doc file
3.获取用于表格标题的行
Row rows = (Row) table.getRows().get(0);//we can set multiple rows as heading by passing it's index
4. 将行设置为HeadingFormat = true
rows.getRowFormat().setHeadingFormat(true);
于 2016-07-05T12:42:23.137 回答
0
- 选择要在模板中重复的标题部分(行/行)。
- 右键单击它。转到表属性并选择行选项卡,其中有第二个选项“在每页顶部重复作为标题行”。
于 2016-07-05T11:55:17.560 回答