PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

Keep Table rows together without page break between them.
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2567
Page 1 of 1

Author:  moizpalitanawala [ Fri Sep 06, 2013 4:18 am ]
Post subject:  Keep Table rows together without page break between them.

Hi, I am generating table which lengths multiple pages. I have groups of 3 rows each. There must not get a page break between the rows in a group. So I tried to set the 1st rows KeepWith=2. For the next two rows I am not setting this property.

But this is not working.. Any idea how to keep rows together without a page break in between them.

Author:  () => true [ Fri Sep 06, 2013 7:16 am ]
Post subject:  Re: Keep Table rows together without page break between them

Hi!

Set KeepWith at the correct Row to make it work.

See also:
http://stackoverflow.com/a/18643633/1015447

Author:  moizpalitanawala [ Sat Sep 07, 2013 1:19 pm ]
Post subject:  Re: Keep Table rows together without page break between them

Hello, Thanks for your help. But it is not working...!!!
I am not using the official assemblies of migradoc but instead I am using this
http://www.pakeha_by.my-webs.org/MigraD ... ender.html

So maybe for this reason it is not working. I am having huge number of rows in the table so it does take almost 20 mins to generate a pdf in official library where as this patched version takes only around 2-3 mins. So I cannot change to the official library.

Is there any other way to Keep the 3 rows group together? Like to predict the page end and make a manual page break or any alternative.. I am also using headers so on every page heading this logo and address header is printed.

Author:  () => true [ Sun Sep 08, 2013 7:22 pm ]
Post subject:  Re: Keep Table rows together without page break between them

Try the "official" library to see if the fault is in your code or in the optimized library.

Pakeha has fixed some faults of his patch - maybe he'll also fix this one (if it is a fault of his library patch).

If it doesn't work with the "official" library, then search the error in your code - maybe show your code here so we can help.

Author:  Thomas Hoevel [ Mon Sep 09, 2013 9:18 am ]
Post subject:  Re: Keep Table rows together without page break between them

moizpalitanawala wrote:
Hello, Thanks for your help. But it is not working...!!!
I am not using the official assemblies of migradoc but instead I am using this
http://www.pakeha_by.my-webs.org/MigraD ... ender.html
It's a known limitation of this patch that KeepWith is not working.
See also:
viewtopic.php?p=6940#p6940

Author:  moizpalitanawala [ Mon Sep 09, 2013 9:22 am ]
Post subject:  Re: Keep Table rows together without page break between them

Is there any other way to do this job? Some other workaround.

Author:  Thomas Hoevel [ Mon Sep 09, 2013 9:29 am ]
Post subject:  Re: Keep Table rows together without page break between them

pakeha_by offered to investigate this problem (see the other thread).

Author:  moizpalitanawala [ Mon Sep 09, 2013 9:34 am ]
Post subject:  Re: Keep Table rows together without page break between them

That post is of 2011. I am using his most recent library so it seems that he has not corrected it.
It would be helpful if you can guide me. If I know that page will break in the next 3 rows than my problem will be solved. I will just add empty rows there.

Author:  Thomas Hoevel [ Mon Sep 09, 2013 12:41 pm ]
Post subject:  Re: Keep Table rows together without page break between them

Quote:
If I know that page will break in the next 3 rows than my problem will be solved.
With MigraDoc you define documents consisting of sections and paragraphs. There are no pages at this stage.

When the document gets rendered to PDF, then pages will be created and pagebreaks will be added.
When you render to RTF, no pagebreaks will be added.

When adding paragraphs, there are no pages and no-one can tell you whether the page is nearly full.

MigraDoc allows you to modify any paragraph at any time. A line may be near the bottom - until you alter the page margins.

Long story short: while adding lines to a table, there are no pages and you cannot find out whether you are near the bottom of a page.

Measure the text you add to tables or otherwise estimate how many rows will fit one page - and start a new table after a pagebreak.

Did you try to contact pakeha_by? His last post is from April 2013 when he offered to look after the KeepWith problem.

Author:  moizpalitanawala [ Sat Sep 14, 2013 5:33 am ]
Post subject:  Re: Keep Table rows together without page break between them

My problem got solved..!! I emailed pakeha and he sent me the fix. The updated assemblies has the issue of KeepWith Property solved..!!
Thanks a lot:-)

Author:  pakeha_by [ Sat Sep 14, 2013 6:22 am ]
Post subject:  Re: Keep Table rows together without page break between them

In case somebody needs KeepWith property to work I've updated patched assemblies: http://www.pakeha_by.my-webs.org/MigraDocFastTableRender.html

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/