Table cells vertical borders lost on docx export

2 Answers 96 Views
WordsProcessing
stim
Top achievements
Rank 1
stim asked on 17 May 2024, 08:55 AM

Hi,

Table cells with individually set vertical borders lose them when DocxFormatProvider is used for export. Import and export the attached file to see the problem. Does anyone know how to fix this? Pdf export seems to work correctly.

Thanks,
stim

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 May 2024, 03:59 PM

Hi, Stim,

The following KB article is quite useful on this topic: Saving DOCX to PDF Removes Table Borders

In a similar way you can also apply the cell borders. Please give this approach a try and see how it works on your end.

I hope you find this information helpful. Please, let me know if there is anything else I can assist you with.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

stim
Top achievements
Rank 1
commented on 20 May 2024, 06:29 AM

Hi, Dess,

When the document is imported (as a template for further processing) the cell borders are there in the created RadFlowDocument object. They disappear when the Export method of DocxFormatProvider is called. I know the trick you pointed out and it doesn't help. Specifically, I tried this for test:

                    foreach (Section section in document.Sections)
                    {
                        foreach (var block in section.Blocks)
                        {
                            Table table = block as Table;
                            if (table != null)
                            {
                                foreach (var row in table.Rows)
                                {
                                    foreach (var cell in row.Cells)
                                    {
                                        cell.Borders = new TableCellBorders(new Border(1, BorderStyle.Single, new ThemableColor(Colors.Black)));
                                    }
                                };
                            }
                        }
                    }

The result is in the attached file.

Regards,
stim

Yoan
Telerik team
commented on 21 May 2024, 11:20 AM

Hello Stim,

Dess is currently absent so I will be taking over for her for the time being.

As a start, I would first like to mention that I tried reproducing the described behavior on my end however the results seem to be as expected and all borders are intact. I am testing in both .NET Framework and .NET Standard with the latest Document Processing version 2024.2.426, but the results seem to be the same with older versions as well.

Perhaps there is something I am missing so would you be able to address as many of the following points as possible in order to provide more context to the scenario?

  • The project environment (.NET Framework / .NET Standard / .NET Core).
  • The used Document Processing version.
  • Are you doing any additional processing of the document?
  • Attach a possible code snippet or a project that can help reproduce the issue.

While sharing resources please keep in mind that because of the nature of the Q&A Forum anything shared here will be accessible to the public.

Thank you in advance for your cooperation.

stim
Top achievements
Rank 1
commented on 27 May 2024, 09:25 AM

Hi,

Currently, we use Net Framework 4.7.2, KendoUI MVC 2023.2.829.545 (installed March this year; the working version was 2020.1.219). After opening, we do process the document, but it doesn't matter. To see the error, it is enough to just open the previously attached Example.docx file and save it without any processing using DocxFormatProvider..

Regards,
stim

0
Yoan
Telerik team
answered on 27 May 2024, 12:42 PM

Hello Stim,

Thank you for the provided context details. I was able to reproduce the disappearing borders on my end as well. This issue appears to be a regression that has already been fixed as it does not reproduce with previous or newer versions of Document Processing.

If it fits your scenario I would advise you to upgrade to an even newer version of the product as it will include improvements and additional features however you can also regress to a lower version where the issue does not reproduce.

Please excuse us for the inconvenience and thank you for your understanding.

Regards,
Yoan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
WordsProcessing
Asked by
stim
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Yoan
Telerik team
Share this question
or