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

Free Support Forum - aspose.com

Cell.GetDispalyStyle() failes for some conditional formatting rules

Hello,

We’ve discovered an issue within Aspose, it seems related to conditional formatting.

I’ve attached a small console application describing the issue - in the TestFile.xlsx, there are a couple of cells from the Display worksheet (within the D7:P31 range) for which the Cell.GetDispalyStyle() call fails within Aspose with the following stack trace:
<<Aspose.Cells.CellsException: Cell contains no data in Cell D8
at Aspose.Cells.Cell.get_DoubleValue()
at .()
at Aspose.Cells.ConditionalFormattingResult.get_ColorScaleResult()
at Aspose.Cells.ConditionalFormattingResult.()
at Aspose.Cells.Cell.GetDisplayStyle()>>.

On a slightly different file (which we cannot attach due to confidential issues) we also obtained a similar stack trace, in the same “get_ColorScaleResult” area, please investigate this also:
<<System.InvalidCastException: Specified cast is not valid.
at .(Cell , ConditionalFormattingValue , CellArea , )
at .()
at Aspose.Cells.ConditionalFormattingResult.get_ColorScaleResult()
at Aspose.Cells.ConditionalFormattingResult.()
at Aspose.Cells.Cell.GetDisplayStyle()>>

We are using Aspose.Cells version 8.0.1.0.

Any feedback will be highly appreaciated.

Thank you,
Mihai Andrei
Sr Software Engineer
IBM Romania

Hi Mihai,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue. Cell.GetDisplayStyle() fails for some conditional formatting rules.

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-42609.

I have attached the output screenshot for a reference.

C#


string filePath = @“F:\TestFile.xlsx”;


Workbook workbook = new Workbook(filePath);


var worksheet = workbook.Worksheets[“Display”];


// some of the cells from the D7:P31 range fail when calling GetDisplayStyle()

for (int i = 6; i <= 30; i++)

{

for (int j = 3; j <= 15; j++)

{

var cell = worksheet.Cells[i, j];

try

{

var cellDisplayStyle = cell.GetDisplayStyle();

}

catch (Exception ex)

{

Console.WriteLine("’{0}’ - GetDisplayStyle failed: ‘{1}’", cell.Name, ex.Message);

}

}//for

}//for



Hi Mihai,

Thanks for using Aspose.Cells.

Please download and try this fix: Aspose.Cells
for .NET v8.0.1.4
and let us know your feedback.

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


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

Hello,

We’ve tested with Aspose.Cells version 8.0.2.0, the original input file indeed seems to have been fixed.

However the 2nd stack trace still reproduces, I’ve attached another test input file, much close to the one which our client is experiencing issues with.

Thank you,
Mihai Andrei
Senior Software Engineer
IBM Romania

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue with the latest version: Aspose.Cells
for .NET v8.1.0.2
.

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-42758.

We have tested this issue with the following code. I have also attached the screenshot showing the output and exception as a reference

C#


string filePath = @“F:\Shak-Data-RW\Downloads\TestFile.xlsx”;


Workbook workbook = new Workbook(filePath);


var worksheet = workbook.Worksheets[“Display”];


// some of the cells from the D7:P31 range fail when calling GetDisplayStyle()

for (int i = 6; i <= 30; i++)

{

for (int j = 3; j <= 15; j++)

{

var cell = worksheet.Cells[i, j];

try

{

var cellDisplayStyle = cell.GetDisplayStyle();

}

catch (Exception ex)

{

Console.WriteLine("’{0}’ - GetDisplayStyle failed: ‘{1}’", cell.Name, ex.Message);

}

}//for

}//for


Exception:
at šŸ.™Ÿ.Calculate(Cell , ConditionalFormattingValue , CellArea ,  )
at šŸ.›Ÿ.•()
at Aspose.Cells.ConditionalFormattingResult.get_ColorScaleResult()
at Aspose.Cells.ConditionalFormattingResult.a‡Š()
at Aspose.Cells.Cell.GetDisplayStyle()
at AsposeProject.Program.f1() in F:\Shak-Data-RW\Projects\AsposeProject\AsposeProject

Additional information: Specified cast is not valid.
Hi,


Please download and try our latest version/ fix: Aspose.Cells for .NET v8.1.0.3

We have fixed your issue now.

Let us know your feedback.

Thanks,

The issues you have found earlier (filed as CELLSNET-42758) 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