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

Free Support Forum - aspose.com

Row repeater

Hello aspose team.

I have an issue repeating table row. I need to repeat few rows at the same time, but that is not possible: aspose exception start and end table should be at the same section or table row. Get to the point to merge those rows in one row and use drawing tool to display as separate rows.Work good if table is not split on pages,but if it come to the bottom of the page, it just cut this table.

Hi Victor,


Thanks for your inquiry. You can use mail merge with regions to achieve this. Please read the details in the following article.
http://www.aspose.com/docs/display/wordsnet/Mail+Merge+with+Regions+Explained
Victor:
Get to the point to merge those rows in one row and use drawing tool to display as separate rows.Work good if table is not split on pages,but if it come to the bottom of the page, it just cut this table.
Could you please attach your input template document, code and output Word/Pdf document showing the undesired behaviour here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Hi, Awais

Was unable to replicate the same issue, but there is similar issue: repeated table rows are broken between the pages. One of them overlayed page footer.

Thank you.

Hi Victor,


Thanks for the additional information. I will work on your query and get back to you shortly.

Best regards,

Hi Victor,


Thank you for being patient. You can resolve your issues by restricting content inside the cells of rows from being split across a page. Please add the following lines of code at the end of Main method of your code:

...

InsertBySectionsKeepingFormatting("Subreport:1", docMainTemlate, docTemlate2);

InsertBySectionsKeepingFormatting("Subreport:0", docMainTemlate, docTemlate1);

// docMainTemlate.MailMerge.ExecuteWithRegions(ds);

foreach (Section section in docMainTemlate.Sections)

{

section.PageSetup.SectionStart = SectionStart.Continuous;

}

NodeCollection tables = docMainTemlate.GetChildNodes(NodeType.Table, true);

foreach (Aspose.Words.Tables.Table table in tables)

foreach (Aspose.Words.Tables.Row row in table)

row.RowFormat.AllowBreakAcrossPages = false;

docMainTemlate.Save(outputPath);


I hope, this helps.

Best regards,