Hi,
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.
Code:
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:
Img1
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?
Img2
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?
Img3
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?
Img4
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,
N