Diagonal border problem

Hi! I’m trying to copy diagonal borders from an Excel range into a pptx table shape. Everything works fine for theme colors, but not for standard colors in Excel. Please, check the attached console application project!

Thank you

Hi Adrian,


I have worked with the sample project shared by you and have observed that you are in fact having issue while getting diagonal color using Aspose.Cells. The diagonal color is read as ARGB(0,255 ,0,0). You see the alpha value is 0 which means that diagonal color will be transparent. If A or alpha value is 255 then diagonal color will be visible. The value of A ranges from 0 to 255. Aspose.Slides sets the same value read using Aspose.Cells. For your kind reference, the image is attached as well to highlight the issue. I am moving this thread to Aspose.Cells where our respective team will help you better in this regard.

Many Thanks,

Hi,

Thanks for your posting and using Aspose components.

I have tested your border issue with the latest version: Aspose.Cells
for .NET v7.2.2.1

and found the problem.

We have logged this issue in our database. We will 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-40784.

Please see the code below. I have attached the source xlsx file and the screenshot for your reference.

C#


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


Workbook workbook = new Workbook(filePath);


var excelCell = workbook.Worksheets[0].Cells[“A1”];

var style00 = excelCell.GetStyle();


var clr1 = style00.Borders[BorderType.DiagonalDown].Color;



excelCell = workbook.Worksheets[0].Cells[“A2”];

var style10 = excelCell.GetStyle();


var clr2 = style10.Borders[BorderType.DiagonalDown].Color;


Screenshot:

Hi,

We have looked into this issue.

Diogonal colors of cell A1 and A2 are both different and for your original problem, The diagonal color is read as ARGB(0,255 ,0,0). You see the alpha value is 0 which means that diagonal color will be transparent.

In Ms-Excel, the value of A does not have any effect, so it is ignored.

It is not an issue of Aspose.Cells for .NET. So, you should set the alpha value to 1 yourself to avoid the issue at your end.