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

Free Support Forum - aspose.com

Rendered text is not as in Excel

Hi,


We are trying to generate files based on the textual information from Excel files through Aspose.Cells and we found some differences between Excel and Aspose.Cells:
1. For “Number” format with parentheses when the value is negative, the rendered value does not contain the extra spaces needed to align the numbers (please see the attached missing-spaces.jpg )
2. The same problem is for “Currency” format with parentheses when the value is negative.
3. For “Accounting” format, Aspose does not provide the correct string value. The string value contains only one space between the currency symbol and the number (we expect the value to be as in Excel. Please see the attached accounting-missing-spaces.jpg )
4. Dates are not rendered correctly (please see the attached date-excel-vs-aspose.jpg, the left column contains Excel dates and the right column contains Aspose dates).

I attached a console application to illustrate these issues as well.

Thanks

Hi,

Thanks for your project files and using Aspose.Cells.

I have ran your code using the latest version:
Aspose.Cells
for .NET v7.2.2.5
and found it is working fine.

Aspose.Cells is showing the string values correctly and there are not any extra white spaces between Ms-Excel and Aspose.Cells, actually you have put these spaces yourself for alignment.

Anyway, I have logged this issue in our database. We will further look into this issue and 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-40819.

Hi,

Thanks for using Aspose.Cells.

Please use our recent fixes/version: Aspose.Cells
for .NET v7.7.0.3
and use Cell.DisplayStringValue to get
the formatted values. All cells should be formatted same with what shown in ms
excel except the cell “A48”. For cell A48, it uses some special calendar type
and number system(custom string “2010000”). Unfortunately, we do not know any
specification about such kind of formatting. So we are afraid we cannot support
it currently.

Hello,

As suggested, we’ve applied Cell.DisplayStringValue and tested against Aspose.Cells version 8.0.2.0.

The values being displayed are indeed better, but there are still a couple of issues related to spacing - Aspose seems to calculate the number of spaces to be displayed a little bit different than Excel.

I’ve attached a small console application and a test file describing the issue - on Sheet1 A column contains the values and the used number formatting, on column B there are the Text display values as given by Excel. Running the applications shows various differences in terms of display value string length, starting from 1 space character to 4 space characters.

The B column from the Excel file was populated using this macro:
Sub DisplayValues()

Dim rCell As Range
Dim dCell As Range
Dim rRng As Range

Set rRng = Sheet1.Range(“A1:A24”)

For Each rCell In rRng.Cells
Set dCell = Cells(rCell.Row, 2)
dCell.NumberFormat = “@”
dCell.Value = rCell.text
Next rCell
End Sub

Any feedback will be highly appreciated.

Thank you in advance,
Mihai Andrei
Senior Software Engineer
IBM Romania

Hi Mihai,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue. The macro results generated by MS-Excel and Aspose.Cells DisplayStringValue results differ.

We have logged your comments and project in our database for investigation against this issue. We will look into it and see if these issues could be resolved. Once, we will have a fix or some other update for you, we will let you know asap.

Hi Mihai,

Thanks for using Aspose.Cells.

Cell.DisplayStringValue is designed to mimic the view of one cell being
shown in MS-Excel by a string. We don’t know the mechanism cell.Text in
macro and cannot make cells’ result same with it exactly.

However, when
we input the string values into cells and see the view in MS Excel, such
as for cell A7, we put macro’s result into A8 and put cells’ result
into A9, we think cells’ result is closer to what the cell A7 is shown
in MS Excel (Please see DisplayStringValue.jpg in the attachment).