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

Free Support Forum - aspose.com

Nested Tables / IsBroken-Issue

We have a main table with IsBroken = true and 2 repeating header rows.
Each row of the main table contains a table with IsBroken = false. My expectation would be that these subtables would not be broken over multiple pages. If one of them doesn’t fit on page 1 the whole table would be displayed on page 2 of the PDF. This is not the case as you can see in the attached PDF file.

You can use the code below to reproduce the issue:

Dim objPDF As New Pdf

Dim objSection As Section = objPDF.Sections.Add()

Dim objTable As Table = New Table(objSection)
objSection.Paragraphs.Add(objTable)

objTable.RepeatingRows = 2
objTable.IsBroken = True
objTable.ColumnWidths = "300"
objTable.DefaultCellBorder = New BorderInfo(BorderSide.All, 1, New Aspose.Pdf.Color(255, 0, 0))

Dim objHeaderRow1 As Row = objTable.Rows.Add()
Dim objHeaderCell1 As Cell = objHeaderRow1.Cells.Add()
objHeaderCell1.Paragraphs.Add(New Text(“Header 1”))

Dim objHeaderRow2 As Row = objTable.Rows.Add()
Dim objHeaderCell2 As Cell = objHeaderRow2.Cells.Add()
objHeaderCell2.Paragraphs.Add(New Text(“Header 2”))

For i As Integer = 1 To 20
Dim objContentRow As Row = objTable.Rows.Add
Dim objContentCell As Cell = objContentRow.Cells.Add()

Dim objContentTable As Table = New Table(objSection)
objContentTable.DefaultCellBorder = New BorderInfo(BorderSide.All, 1, New Aspose.Pdf.Color(0, 0, 255))

objContentCell.Paragraphs.Add(objContentTable)
objContentTable.IsBroken = False

For j As Integer = 1 To 4
Dim objContentTableRow As Row = objContentTable.Rows.Add()
objContentTableRow.IsBroken = False
Dim objContentTableCell As Cell = objContentTableRow.Cells.Add()
objContentTableCell.Paragraphs.Add(New Text("Test " & i & " " & j))
Next
Next

objPDF.Save(“c:\temp\test.pdf”)

Hi,

Thanks for using our products.

I have tested the scenario and I am able to notice the problem. We are looking into the details of this problem and will keep you updated on the status of correction. Please spare us little time and we will get back to you with the status of correction, shortly. We apologize for your inconvenience.

Hello codewarior,

I'm replying here for CarloComartis, he's out for a week and can't answer directly.

In the first post from CarloComartis he has posted the code you need to reproduce the problem. It should all be there, do you need additional code to that? Unfortunately I don't have the pdf.

best,
Dave

Hello Dave,

I was able to notice the problem using the code snippet shared in first post of this thread. Our development team is looking into the details of this problem and once we have some definite news regarding its resolution, we would be pleased to update you with the status of correction.

Please be patient and spare us little time. Your cooperation and comprehension is greatly appreciated in this regard. We are sorry for your inconvenience.

Hi,



Any news on this issue? It’s been 3 weeks now. Can you give us an ETA
for a fix?



Carlo

Hello Carlo,

Thanks for your patience.

We plan to get this issue resolved by the end of this month or early next month. As soon as we have some definite information regarding its resolution, we would be pleased to update you with the status of correction. Please be patient and spare us little time.

We greatly appreciate your patience and comprehension in this regard. We apologize for the delay and inconvenience.

Hello carlo,

After further investigation, we have found that the issue does not seem to be related to Aspose.Pdf for .NET. In fact, if you add objTable.IsRowBroken = False code line right after objHeaderCell2.Paragraphs.Add(New Text("Header 2")), you can get the desired output. Please take a look over the attached PDF document generated with updated code while using Aspose.Pdf for .NET 4.5.0.

In case the problem still persists, or you have any further query, please feel free to contact. We apologize for your inconvenience.

The issues you have found earlier (filed as 18010) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)
codewarior:

Hello carlo,

After further investigation, we have found that the issue does not seem to be related to Aspose.Pdf for .NET. In fact, if you add objTable.IsRowBroken = False code line right after objHeaderCell2.Paragraphs.Add(New Text("Header 2")), you can get the desired output. Please take a look over the attached PDF document generated with updated code while using Aspose.Pdf for .NET 4.5.0.

In case the problem still persists, or you have any further query, please feel free to contact. We apologize for your inconvenience.



Hi codewarior,

I tried to change the code as suggested by you. Attached is the output we get. The output is different from the one you attached to your previous post. Because IsBroken is now set to False on the outer table the table now starts on the second page because it doesn't fit on the first page. Also the inner table is still broken even though IsBroken is set to False on the inner table! Setting the outer table IsBroken to False can't be the solution anyway. We want this table to break over multiple pages. Only the inner tables should stay together and must not be broken.

I tried this with both Aspose.Pdf 4.5.0 and 4.6.0. The issue is not yet resolved!

Output and Code attached...

Carlo

Sorry, false alarm…I misread your code and set IsBroken to false instead of IsRowBroken. Everything works fine now. Thank you!