Append the Word Continued to Row Header in Pdf Using Aspose Pdf

Default Splitting

Suppose you create a table in your document and keep on adding data to it. After you finish entering data in table, you experience that the data entered in the table was in large quantity and that's why your table takes the space of more than a page. Actually, in such situations, all document processing applications split the table into two parts (to fit on two pages of the document). Another reason might be the addition of table at the end of the page. So, your table might be small but because of being added to near to the end of the page causes it to take some space on the next page too. And this is done because of printing purposes so that all records of the table should be printed and not missed.

The default situation is described in the figure below:

Default

Figure: Default situation showing remaining records on next page

In the figure above, you can see the default situation where the remaining records of the table are appended to the next page, splitting one table into two ones.

Aspose.Pdf allows you to control this default behavior of Table splitting in two ways like:

  • Repeating First Row
  • Stop Table Breaking

Repeating First Row

We know that all tables have a header row that contains the headings of the table columns just to mention that which column is displaying which information. If a table is too big to displ a y in a page, it will be split into two tables and second part of table will take some space of the next coming page. But, by default, the second part of the table looses the header row and displays only the remaining records. It may cause a conflict for the reader while analyzing the contents of the table. Reader of the document may forget that which column is showing which kind of information and he may have to scroll up to the previous page to take a look on the header row again.

Aspose.Pdf provides a simplest solution to this general reading problem and provides IsFirstRowRepeated property in Table class. Developers can simply set this boolean property to true to add the same header row (of the table on the previous page) on the top of the rema ining rows of the split Table on the next page. This splitting behavior of the Table can be experienced from the figure below:

First Row Repeat

Figure: First or header row repeat demostration

The code snippet to use IsFirstRowRepeated property is given below in the example.

Code Snippet

[C#]

table1.IsFirstRowRepeated = true;

[VB.NET]

table1.IsFirstRowRepeated = True

[XML]

<Table IsFirstRowRepeated = "true">

     ...

</Table>

Stop Table Breaking

If you have added the table in your PDF document near to the end of the page then your table will be broken into two parts showing one part on first page and other part on the next page. Aspose.Pdf allows you to stop your table to break into two parts. It is possible using IsBroken property of Table class. You can set this boolean property to false to stop your table from being broken. If you do it then complete table will be switched to next page where it can be shown fully without any need of breaking it into parts. This effect can be seen in the figure below:

First Row Repeat

Figure: Complete table without breaking

In the figure above, you can see that there is an empty space above the Page Break because Table is not broken and complete table is switched to the next page after Page Break.

The code snippet to use IsBroken property is given below in the example.

Code Snippet

[C#]

table1.IsBroken = false;

[VB.NET]

table1.IsBroken = False

[JAVA]

table.setIsBroken(false);

[XML]

<Table IsBroken = "false">

     ...

</Table>

Note: If you set IsBroken property to false and the table is too large to be displayed in one page then an exception will be thrown.

terrellsopland.blogspot.com

Source: https://origin2.componentsource.com/sites/default/files/resources/aspose/534941/doc/Control-Table-and-Row-Splitting.html

0 Response to "Append the Word Continued to Row Header in Pdf Using Aspose Pdf"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel