ColSpan bug with Table.Broken property

Hi,


I’m having an issue with ColSpans and the TableBroken.Vertical and TableBroken.VerticalInSamePage enums. It looks like columns you want to span are on another page because of the wide table breakage. An out of range exception is being thrown when I try to call ProcessParagraphs or Save on the document. For example, in this sample there are 6 columns. The first 3 span fine, but the second span won’t work because it’s trying to span the last column on the first page and the two columns on the second page.

        // Added document
Document doc = new Document();
Aspose.Pdf.Page page = doc.Pages.Add();
//Instantiate a table object
Aspose.Pdf.Table mytable = new Aspose.Pdf.Table();
mytable.Broken = TableBroken.Vertical;
//Add the table in paragraphs collection of the desired section
page.Paragraphs.Add(mytable);
//Set with column widths of the table
mytable.ColumnWidths = “100 100 100 100 100 100”;
    //Add colspan header Row
    Aspose.Pdf.Row headerRow1 = mytable.Rows.Add();
    var firstspan = headerRow1.Cells.Add("header span 3");
    firstspan.ColSpan = 3;
    firstspan.BackgroundColor = Color.LightBlue;
    //Breaks because the colspan cell is split between multiple pages
    var secondspan = headerRow1.Cells.Add("header span 3");
    //secondspan.ColSpan = 3;
    secondspan.BackgroundColor = Color.LightGreen;

    //Add header Row 2
    Aspose.Pdf.Row headerRow2 = mytable.Rows.Add();
    headerRow2.Cells.Add("header 1");
    headerRow2.Cells.Add("header 2");
    headerRow2.Cells.Add("header 3");
    headerRow2.Cells.Add("header 4");
    headerRow2.Cells.Add("header 5");
    headerRow2.Cells.Add("header 6");

    for (int RowCounter = 0; RowCounter <= 5; RowCounter++)
    { 
        //Create rows in the table and then cells in the rows 
        Aspose.Pdf.Row row1 = mytable.Rows.Add();
        row1.Cells.Add("col " + RowCounter.ToString() + ", 1");
        row1.Cells.Add("col " + RowCounter.ToString() + ", 2");
        row1.Cells.Add("col " + RowCounter.ToString() + ", 3");
        row1.Cells.Add("col " + RowCounter.ToString() + ", 4");
        row1.Cells.Add("col " + RowCounter.ToString() + ", 5");
        row1.Cells.Add("col " + RowCounter.ToString() + ", 6");
    }

    doc.Save("BrokenWideTableColSpans.pdf");</code></pre></div>

Hi Daniel,

Thanks for your inquiry. I have tested your scenario with Aspose.Pdf for .NET 11.3.0 and managed to observe the reported issue with ColSpan and Table.Broken properties. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-40358 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

The issues you have found earlier (filed as PDFNEWNET-40358) have been fixed in Aspose.Pdf for .NET 11.7.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
There is a problem with the release as one of the cells in the first row, when the table splits has background color white, even though i specifically set the color to blue.
I think this is due when table breaks. Here you have the code to reproduce the problem.
// Added document
Document doc = new Document();
Aspose.Pdf.Page page = doc.Pages.Add();
//Instantiate a table object
Aspose.Pdf.Table mytable = new Aspose.Pdf.Table();
mytable.Broken = TableBroken.Vertical;
//Add the table in paragraphs collection of the desired section
page.Paragraphs.Add(mytable);
//Set with column widths of the table
mytable.ColumnWidths = "100 100 100 100 100 100";

//Add colspan header Row
var headerRow1 = mytable.Rows.Add();
var firstspan = headerRow1.Cells.Add("header span 1");
firstspan.ColSpan = 1;
firstspan.BackgroundColor = Color.LightBlue;
//Breaks because the colspan cell is split between multiple pages
var secondspan = headerRow1.Cells.Add("header span 1");
secondspan.ColSpan = 1;
secondspan.BackgroundColor = Color.LightBlue;
var thirdspan = headerRow1.Cells.Add("header span 4");
thirdspan.ColSpan = 4;
thirdspan.BackgroundColor = Color.LightBlue;
//Breaks because the colspan cell is split between multiple pages
var forthspan = headerRow1.Cells.Add("header span 4");
forthspan.ColSpan = 4;
forthspan.BackgroundColor = Color.LightBlue;


//Add header Row 2
var headerRow2 = mytable.Rows.Add();
headerRow2.Cells.Add("header 1").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 2").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 3").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 4").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 5").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 6").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 7").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 8").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 9").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 10").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 11").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 12").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 13").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 14").BackgroundColor = Color.LightCoral;
headerRow2.Cells.Add("header 15").BackgroundColor = Color.LightCoral;

for (int RowCounter = 0; RowCounter <= 50; RowCounter++)
{
//Create rows in the table and then cells in the rows
Aspose.Pdf.Row row1 = mytable.Rows.Add();
row1.Cells.Add("col " + RowCounter.ToString() + ", 1");
row1.Cells.Add("col " + RowCounter.ToString() + ", 2");
row1.Cells.Add("col " + RowCounter.ToString() + ", 3");
row1.Cells.Add("col " + RowCounter.ToString() + ", 4");
row1.Cells.Add("col " + RowCounter.ToString() + ", 5");
row1.Cells.Add("col " + RowCounter.ToString() + ", 6");
row1.Cells.Add("col " + RowCounter.ToString() + ", 7");
row1.Cells.Add("col " + RowCounter.ToString() + ", 8");
row1.Cells.Add("col " + RowCounter.ToString() + ", 9");
row1.Cells.Add("col " + RowCounter.ToString() + ", 10");
row1.Cells.Add("col " + RowCounter.ToString() + ", 11");
row1.Cells.Add("col " + RowCounter.ToString() + ", 12");
row1.Cells.Add("col " + RowCounter.ToString() + ", 13");
row1.Cells.Add("col " + RowCounter.ToString() + ", 14");
}

doc.Save("BrokenWideTableColSpans.pdf");
We need an answer ASAP on this issue.
Thank you,
Daniel

Hi Daniel,


Thanks for your inquiry. I have tested the scenario and noticed the header cell background color issue, so logged a ticket PDFNET-41369 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,

The issues you have found earlier (filed as PDFNET-41369) have been fixed in Aspose.Pdf for .NET 16.10.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Upgraded to latest version and issue is fixed.

Thank you.

Hi Daniel,


Thanks for the acknowledgement.

We are glad to hear that your problems are resolved. Please continue using our API’s and in the event of any further query, please feel free to contact.