We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

avoid page break between 2 table rows

Hi,
I want to avoid a page break between 2 table rows.
Word can do that.
Is it possible with DocIO?

Bodo

5 Replies

PE Priyanga Elangovan Syncfusion Team June 17, 2016 08:39 AM UTC

Hi Bodo,

Thank you for contacting Syncfusion support.

On further analyzing your requirement, to remove the pagebreak in between two tables as equivalent to Word, we have prepared a demo sample using DocIO with two buttons to illustrate your requirement.The first button removes the pagebreak from the paragraph if the paragraph has pagebreak and present in between two tables and the second button removes the entire paragraph if the paragraph has pagebreak and present in between two tables. Please find the sample from below link and let us know if it helps.

Sample link
http://www.syncfusion.com/downloads/support/forum/124599/ze/GenerateWord_Windows-1042326147.zip

Note:
If you use the second button to remove the complete paragraph, then the two tables in the generated Word document will looks like single table while viewing the generated document in Microsoft Word application but in file level it is preserved as two table.

If we misunderstood your requirement, kindly elaborate your requirement with clear description (like screenshot of your output or expected output document), Thereby we will analyse further on your requirement and update you appropriate solution at the earliest.

Regards,
Priyanga.E
 



BJ Bodo Jäger June 17, 2016 09:59 AM UTC

Thank you for your reply, but you missunderstand me.

I create a table and add a lot of rows, with row.RowFormat.IsBreakAcrossPages = false.
This avoid a page break inside a row, and Word breaks the page between 2 rows, if the second flows over the page.

My problem is, that I need to hold two rows together, so that Word breaks the page before this two rows, of after these two rows, but never betwenn them.

Bodo





PE Priyanga Elangovan Syncfusion Team June 18, 2016 05:53 AM UTC

Hi Bodo,

Thank you for your update

On further analyzing your requirement, to preserve the two adjacent rows in the same page as equivalent to Word, we have prepared a demo sample using DocIO to illustrate your requirement. You can achieve your requirement by setting the WParagraph.ParagraphFormat.KeepFollow property as true to the first paragraph of the first row of two rows which should be preserved together in the same page. Please find the sample from below link and let us know if it helps

Sample linK
http://www.syncfusion.com/downloads/support/forum/124599/ze/GenerateWord_Windows-9717678.zip

Regards,
Priyanga.E
 



BJ Bodo Jäger June 20, 2016 06:55 AM UTC

Thanks for your solution.

It works, but there is another condition that has to be true.

In my case I have a multi coloum table, only with text in the second column.
I must assign the KeepFollow property to an paragraph (in my case he is empty) in the first column.

But that's no problem for me

Bodo


PE Priyanga Elangovan Syncfusion Team June 21, 2016 05:30 AM UTC

Hi Bodo,

Thank you for your update

Please get back to us if you need any further assistance.

Regards,
Priyanga.E
 


Loader.
Live Chat Icon For mobile
Up arrow icon