Aspose Cells Save as Word

Using the Workbook Save option to save as docx produces table cells with thick borders. Is there a way to produce output without the borders?

Also, noticed there a utility called ConverterXls2Doc.cs. Can I get the source?

Thanks

@buckaroobanzaiii,

Those borders are also there in Excel spreadsheet, so they would be rendered when you convert to DOCX. Could you please zip and attach your input Excel file, we will check it soon.

This is an older utility probably written by Aspose.Words team which is not official or reliable. It is better to use relevant Aspose.Cells APIs for the conversion (Excel to DOCX) as you are already doing.

The issue is that the borders render as if the Excel cell format preset is set to “Inside” when in fact its set to “None”. If you print preview the attached xlsx in Excel, you’ll see there are no borders around the individual cells whereas the converted Word table has thick borders around the cells.

Note, I also noticed Excel headers and footers are not brought into the rendered Word document. Is this a bug?

Thanks!

AsposeCellsToWordExample.zip (7.9 KB)

@buckaroobanzaiii,

Please notice, I am able to reproduce the issue as you mentioned by converting your template file to DOCX file format. I found unnecessary borders are added for the data (cells) in Excel to DOCX conversion. I tried to remove the borders manually in code but still the borders are rendered.
e.g.
Sample code:

            Workbook workbook = new Workbook("e:\\test2\\AsposeCellsToWordExample.xlsx");
            Worksheet worksheet = workbook.Worksheets[0];
            /*
            Range range = worksheet.Cells.MaxDisplayRange;
            Style style = workbook.CreateStyle();
            style.Borders[BorderType.TopBorder].LineStyle = CellBorderType.None;
            style.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.None;
            style.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.None;
            style.Borders[BorderType.RightBorder].LineStyle = CellBorderType.None;
            StyleFlag flag = new StyleFlag();
            flag.Borders = true;
            range.ApplyStyle(style, flag);
            */

            worksheet.PageSetup.PrintGridlines = false;
            
            DocxSaveOptions saveOptions = new DocxSaveOptions();

            workbook.Save("e:\\test2\\out1.docx",  saveOptions);

I have logged a ticket with an id “CELLSNET-51461” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

It might be a limitation in Excel to DOCX rendering. Anyways, could you please share the sample document, we will check it soon.

Thank you for opening the ticket. Here is an Excel workbook with headers and footers.AsposeCellsToWordExampleHF.zip (8.0 KB)

@buckaroobanzaiii,

Thanks for the document.

Please notice, I am able to reproduce the issue as you mentioned by converting your template file to DOCX file format. I noticed Excel headers and footers are not brought into the rendered Word document. I have logged a separate ticket with an id “CELLSNET-51462” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

@buckaroobanzaiii,

This is to inform you that your issue (logged earlier as “CELLSNET-51461”) has been resolved. The fix will be included in our upcoming release (Aspose.Cells v22.9) scheduled in the second week of September 2022. You will also be notified when the next version is released.

The issues you have found earlier (filed as CELLSNET-51461) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

@buckaroobanzaiii,

We are pleased to inform you that your issue (logged earlier as “CELLSNET-51462”) has been resolved now. The fix will be included in our upcoming release (Aspose.Cells v23.12) scheduled in the first half of December 2023. You will also be notified when the next version is released.

The issues you have found earlier (filed as CELLSNET-51462) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi