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

Free Support Forum - aspose.com

Colored number formats

Hi,


I have a cell with the following number format:

"[$$-C09]#,##0.00;[RED]-[$$-C09]#,##0.00"

That will make a cell go red when negative. I tried to get the style for a cell when a negative number is on it, but I don’t see the red color in the font or using getForegroundColor().

How can I get the current cell color in this case?

Thanks!

Hi Agnes,


Thank you for contacting Aspose support.

We have evaluated your presented scenario on our end. Unfortunately, we were unable to retrieve the text color from the cell after applying the number format as “[$$-C09]#,##0.00;[RED]-[$$-C09]#,##0.00” and setting the a negative value. The Cell.getDisplayStyle method should return the style as displayed in the Excel spreadsheet, but all the properties related to the colors are returning 0 when accessed through Aspose.Cells APIs. We have logged an investigative ticket (CELLSJAVA-40827) in our bug tracking system to look further into this matter. Please spare us little time to properly analyze the problem cause, and to provide a fix or a workaround at earliest. In the meanwhile, we will keep you posted with updates in this regard.

Thank you for your response.


If this get fixed, will it be through getConditionalFormattingResult() instead of getDisplayStyle(), or similar? I see this as a consequence of a conditional formatting, not a normal one.

Currently I’m using getSharedStyleIndex() to get the styles, except in the case where getFormatConditions() returns something. In that case I use getConditionalFormattingResult() to render the style. It will be nice if this worked like that, or similar (getNumberFornatCondition() and getNumberFormatStyle() or something like that)

Anyway, thank you very much, I’ll wait for the results.

Hi Agnes,


Thank you for writing back.

We have logged your comments to the ticket already associated with this thread, and requested the development team to review the complete scenario. As soon as we get some news, we will post here for your kind reference.

The issues you have found earlier (filed as CELLSJAVA-40827) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan