I have two issues, first I need to add a manual page break into my table (at a place where it makes sense and not just somewhere automatically). Second, all my cells have a bottom line, but the last one should not have one.
I’ve looked at this for the page break and at the forums, but did not find anything usefull:
https://docs.aspose.com/words/net/mail-merge-and-reporting/
I need to be able to control the page break somehow, either with an Mailmerge IF in the document, or via code. I’ve tried to add a PageBreak like this to the table, but nothing happens:
public void MailMerge_MergeField(object sender, MergeFieldEventArgs e)
{
string value = e.FieldValue.ToString();
DocumentBuilder builder = new DocumentBuilder(e.Document);
builder.MoveToField(e.Field, false);
if (e.DocumentFieldName.StartsWith("TextType"))
{
builder.InsertBreak(BreakType.PageBreak);
}
}
Second, the buttom border of the cell, if tried this (not specific to the last row yet):
public void MailMerge_MergeField(object sender, MergeFieldEventArgs e)
{
string value = e.FieldValue.ToString();
DocumentBuilder builder = new DocumentBuilder(e.Document);
builder.MoveToField(e.Field, false);
builder.CellFormat.Borders.Bottom.LineStyle = LineStyle.None;
}
Works for every cell, but the last one
I’ve attached the document.