We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

TrimLeadingBlankRowAndColumn inconsistency


I saw an issue where Aspose output does not seem to be correct when using TrimLeadingBlankRowAndColumn option. The result seems to be different from Excel ‘Save as’ CSV.

var options = new TxtSaveOptions { TrimLeadingBlankRowAndColumn = true };
using (var convertedDocument = new Workbook(“sourceFile.xlsx”))
convertedDocument.Save(“outputFile.csv”, options);

I have attached screenshots and test files for your reference.
img5.png (9.1 KB)
img4.png (5.1 KB)
img3.png (2.7 KB)
img2.png (3.2 KB)
img1.png (4.3 KB)
testFilesXlsxAndCsv.zip (30.2 KB)

1/ You can see that the rows are trimmed differently depending on the style change of the rows. What should be the expected output for the following cases:

INPUT -> Only text on the 10th row
OUTPUT -> One line with the text. Everything else is trimmed.
COMMENT -> Is that okay or the output should be of 10 lines where the last one is with the text?

INPUT -> Text on 10th row + red cell on 1st row
OUTPUT -> 10 lines. 1st with the style cell and 10th with the text
COMMENT -> Are we expecting 10 lines or 2 lines as output?

INPUT -> Text on 10th row + hidden 1st row
OUTPUT -> 2 lines, 1st with hidden row and 2nd with the text
COMMENT -> Are we expecting 10 lines or 2 lines as output?

INPUT -> Text on 10th row + hidden 1st row + red cell on 3rd row
OUTPUT -> 8 lines, 1st with hidden row, 2nd with style cell, 8th with text
COMMENT -> Why is the text on the 8th line and why is the 2nd empty row trimmed?

2/ From img5.png, you can see that there is some inconsistency between the trimming of columns and rows. When there is a style change in a row (e.g. colour), Aspose doesn’t trim it. However, when there is a style change in the column, Aspose trims it. I was wondering if that was an expected behavior because the property is called TrimLeadingBlankRowAndColumn and I thought that it would behave the same way for both rows and columns.

Thank you,

We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.
Please note that I could not observe any issue for img1.xlsx file as it is converted to CSV file similar to the one created by MS Excel (Office 365).

This issue has been logged as

CELLSNET-47268 – TrimLeadingBlankRowAndColumn inconsistency


This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

The issues you have found earlier (filed as CELLSNET-47268) have been fixed in Aspose.Cells for .NET v20.4. This message was posted using Bugs notification tool by Amjad_Sahi