I have a table and when it wraps to a second page is overlapped by the footer hiding either completely or partially a row before the table goes to the next page. I’ve set RowFormat.AllowBreakAcrossPage = False and it seems to be working (the row on the next page looks correct). It seems like that something isn’t recognizing the footer so it keeps writing the table for another line and detects the end of the page. I’ve manually set the margins could that have some affect? I’ve attached an example PDF.
Hello
Thanks for your inquiry. Could you please attach your input document here for testing? We will check the problem and provide you more information.
Best regards,
We dynamically generate the document via the code so I don’t have an input document I’m afraid.
Hi there,
Thanks for the additonal information.
Could you please post the code you are using to generate your tables here? I will take a closer look for you.
Thanks,
Here’s the code that draws the table:
builder.Writeln("")
builder.Writeln("The following were collected during the course of the inspection for further analysis:")
builder.Writeln("")
pageDivision = 4
Dim colCount As Integer = 0
recordsDT1 = get_datatable(query)
builder.Font.Size = 10
builder.StartTable()
builder.RowFormat.AllowBreakAcrossPages = False
builder.RowFormat.Alignment = Tables.RowAlignment.Center
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center
builder.RowFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single
' Build table header
For Each dr As datarow In recordsDT1
Select Case type
Case "1"
builder.InsertCell()
builder.Bold = True
builder.CellFormat.Width = (builder.PageSetup.PageWidth / pageDivision) - 45
builder.Write(dr("header"))
Case "2"
builder.InsertCell()
builder.Bold = True
builder.CellFormat.Width = (builder.PageSetup.PageWidth / pageDivision) - 45
builder.Write(dr("header"))
Case Else
' no op
End Select
Next
builder.EndTable()
builder.Font.Size = 10
builder.Bold = False
builder.StartTable()
builder.RowFormat.Borders.LineStyle = Aspose.Words.LineStyle.Single
builder.RowFormat.AllowBreakAcrossPages = False
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left
recordsDT = get_datatable(query)
' Iterate query results
For Each row As DataRow In recordsDT.Rows
If row("fld_default") = 0 Then
Dim endrow As Boolean = False
For Each dr As datarow In recordsDT1
Select Case type
Case "1"
builder.InsertCell()
builder.CellFormat.Width = (builder.PageSetup.PageWidth / pageDivision) - 45
builder.Write(dr("value"))
endrow = True
Case "2"
builder.InsertCell()
builder.CellFormat.Width = (builder.PageSetup.PageWidth / pageDivision) - 45
If dr("value") <> "" Then
builder.Write(CDate(dr("value")).ToString("MMMM dd, yyyy") & " ")
Else
builder.Write(dr("value"))
End If
endrow = True
Case "3"
builder.InsertCell()
builder.CellFormat.Width = (builder.PageSetup.PageWidth / pageDivision) - 45
builder.Write(dr("value"))
endrow = True
Case Else
End Select
Next
If endrow Then
builder.EndRow()
End If
End If
Next
builder.EndTable()
builder.RowFormat.Borders.LineStyle = Aspose.Words.LineStyle.None
builder.Font.Size = 12
builder.Writeln("")
builder.Writeln("")
Hi
Thank you for additional information. Unfortunately, I’m unable to reproduce the problem on my side. I use the latest version of Aspose.Words 9.4.0 for testing. Please try using the latest version of Aspose.Words and let me know how it goes on your side.
If the problem still exists with the latest version, could you please try creating the simple application which will allow me to reproduce the problem on my side?
Best regards,