Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Wed Feb 12, 2020 10:47 am

Hello
I'm using Spire.doc v8.1.10
Loading A.docx
Get first table T in A.docx
T has 3 columns, 3 rows
first row : cells col:0 to col:2 are horizontally merged
I split cell (col:1,row:2) in 3 new cells
First row should (as in Word) span 5 columns in DOCX and PDF formats.
3 new cells should (as in Word) have same width in DOCX format.
surprisingly, they are in PDF format
All is correct if I split cell(col:2,row:2)

See attachment

Code: Select all
    public void DoBugSplitCell()
    {
      Document document = new Document("A.docx");
      Table tbl = GetTables(document)[0];
      tbl.Rows[2].Cells[1].SplitCell(3, 1);
      document.SaveToFile("A1.docx", FileFormat.Docx);
      Process.Start("A1.docx");
      ToPdfParameterList toPdfParameterList = new ToPdfParameterList { UsePSCoversion = true };
      document.SaveToFile("A1.pdf", FileFormat.PDF);
      Process.Start("A1.pdf");
    }

    private List<Table> GetTables(Document document)
    {
      List<Table> result = new List<Table>();
      foreach (Section section in document.Sections)
      {
        foreach (var item in section.Body.ChildObjects)
        {
          if (item is Table)
          {
            result.Add(item as Table);
          }
        }
      }
      return result;
    }
You do not have the required permissions to view the files attached to this post.

danielhalte1
 
Posts: 23
Joined: Sat Dec 14, 2019 12:50 am

Wed Feb 12, 2020 11:01 am

workaround : split merged cells of row 0, split target cell, merge cells of row 0
Code: Select all
      tbl.Rows[0].Cells[0].SplitCell(3, 1);
      tbl.Rows[2].Cells[1].SplitCell(3, 1);
      tbl.ApplyHorizontalMerge(0, 0, 2);

danielhalte1
 
Posts: 23
Joined: Sat Dec 14, 2019 12:50 am

Wed Feb 12, 2020 1:02 pm

EDIT : another bug : only last new cell reproduces style and format of original cell

danielhalte1
 
Posts: 23
Joined: Sat Dec 14, 2019 12:50 am

Thu Feb 13, 2020 7:08 am

Hello,

Thanks for your inquiry.
Regarding the first issue you mentioned, glad to hear you have found a workaround. However, I also tested your code and indeed reproduced it on my side. This issue has been logged into our bug tracking system with the ticket SPIREDOC-3916.
As for another issue, I did notice that only the last new cell copied the style and format of original cell. This issue has also been logged into our bug tracking system with the ticket SPIREDOC-3917.
If there is any update on your two issues, I will let you know. Sorry for the inconvenience caused.
Besides, to help us record your issue better, could you please provide your input file for the second issue? Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 645
Joined: Tue Jul 09, 2019 2:22 am

Wed Mar 25, 2020 10:00 am

Hello,

Thanks for your patient waiting.
Glad to inform that the bug SPIREDOC-3917 has been fixed now. Welcome to download the latest Spire.Doc Pack(hot fix) Version:8.3.15 from the following link.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Doc/8.3.15

As for the bug SPIREDOC-3916, our Dev team is still fixing it. If there is any update, I will inform you.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 645
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.Doc