I created a table in Excel with around 120 rows. When I insert this table back into Excel, all 120 rows are displayed correctly.
However, when I insert the same table into Word, only the first 55 rows are visible initially. After debugging, I saved the generated Word document (.docx) locally and checked the structure. What I observed is that after the 55th row, Word introduces some extra spaces or breaks in the document, and then continues with the remaining rows of the table separately.
This behavior causes the table to appear broken or split incorrectly in Word, even though it works fine in Excel.
I’m attaching the sample .docx file for reference. Book_1758196616.zip (21.7 KB)
It seems you’re encountering an issue with the table formatting when transferring data from Excel to Word. The behavior you’re describing, where only the first 55 rows are visible and extra spaces or breaks appear, can often be attributed to Word’s handling of large tables.
To resolve this, consider the following steps:
Check Table Properties: Ensure that the table’s properties in Word are set to allow for proper display, such as adjusting the row height and ensuring that “Allow row to break across pages” is enabled.
Adjust Page Layout: Sometimes, page margins or layout settings can affect how tables are displayed. Try adjusting these settings to see if it resolves the issue.
Insert as an Object: Instead of pasting the table directly, try inserting it as an object. This can sometimes preserve the formatting better.
If the problem persists, please provide additional details about your Word version and any specific formatting applied to the table.
Kindly note that by default, Aspose.Cells renders Excel spreadsheets to DOCX based on the print previews of the sheets in Microsoft Excel. As a result, page breaks may be inserted at varying positions. You may check the print preview of a sheet in your Excel file to verify this.
If you want all rows should be continuously rendered on the DOCX page, you may try to set OnePagePerSheet option of DocxSaveOptions, see and try the following sample code:
Workbook workbook = new Workbook("e:\\test2\\Book_1758196616.xlsx");
DocxSaveOptions saveOptions = new DocxSaveOptions();
saveOptions.OnePagePerSheet = true;
workbook.Save("e:\\test2\\out1.docx", saveOptions);
Please find attached the output DOCX for your reference. out1.docx (19.7 KB)
@Yaparthi_Sumanth
We can obtain the correct results by testing on the latest version v25.9 using the following sample code. Please refer to the attachment. out_net.docx (20.6 KB)
Workbook workbook = new Workbook(filePath + "Book_1758196616.xlsx");
var saveOptions = new DocxSaveOptions();
saveOptions.AsNormalView = true;
workbook.Save(filePath + "out_net.docx", saveOptions);