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

Free Support Forum - aspose.com

Cell.DisplayStringValue adds extra spaces for Cells using Distributed horizontal alignment with Aspose.Cells for .NET in C#


We’ve discovered some issues with Cell.DisplayStringValue, it seems for Cells using Distributed horizontal alignment, the resulted string is different as opposed to the actual text being displayed by MS Excel.

I’ve attached a small console application describing the issue. The input test file contains a couple of cells using Distributed horizontal alignment, the cells don’t have any particular formatting applied on them, they contain just some text. For these cells, Aspose seems to add a couple of extra spaces in the Cell.DisplayStringValue, instead of returing the string without spaces, as MS Excel actually displays it.

We are using Aspose.Cells version

Thank you,
Mihai Andrei
Senior Software Engineer
IBM Romania

Hi Mihai,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after running your sample code with your sample xlsx file using the latest version: Aspose.Cells for .NET (Latest Version).

We noticed that Cell.DisplayStringValue adds extra spaces for Cells using Distributed horizontal alignment.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-42769.

Hi Mihai,

Thanks for using Aspose.Cells.

It is the expected result for Cell.DisplayStringValue. DisplayStringValue is
designed to give string representation to simulate what a cell being shown in ms

For distributed content, we use extra spaces to make the resultant string
similar with what is shown in MS-Excel.