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

Free Support Forum - aspose.com

Setting some borders for table cells doesn't work

Hi,

We’re using Aspose.Slides to build a table based on a table located in a Excel file.
But for some borders it doesn’t work as expected (please see the attached image 33164.jpg showing how the table looks like in Excel and how it looks in PowerPoint).
For reproducing the issue please use the attached PPTX file and the following code:

var presentation = new Presentation(“33164.pptx”);

var initialRightborderCell = ((Table) presentation.Slides[0].Shapes[0]).Rows[5][2].BorderRight;

Console.WriteLine(“Cell’s right border FillType is {0}”, initialRightborderCell.FillFormat.FillType);
Console.WriteLine(“Cell’s right border SolidFillColor is {0}”, initialRightborderCell.FillFormat.SolidFillColor);

var cellLeftBorderColor = ((Table) presentation.Slides[0].Shapes[0]).Rows[5][2].BorderLeft.FillFormat.SolidFillColor.Color;

initialRightborderCell.DashStyle = LineDashStyle.Solid;
initialRightborderCell.Style = LineStyle.Single;

initialRightborderCell.FillFormat.FillType = FillType.Solid;
initialRightborderCell.FillFormat.SolidFillColor.Color = cellLeftBorderColor;
initialRightborderCell.Width = 1;

presentation.Save(“out.pptx”, SaveFormat.Pptx);


Now open out.pptx in PowerPoint and check the right border of the cell used in the code above, it should be red but it’s not.

This issue is occurring for other borders too, they can be located by comparing the Excel and PowerPoint tables in 33164.jpg.

InternalId: 33164

Best regards,
Aurelian Iordache
Software Developer
IBM Romania

Hi Aurelian,


I have observed your comments and like to share with you that I have made necessary changes in the code as per your requirements. This code sets the color of Left Border of cell[5,2] as the color of cell [1,1] or any other cell. To differentiate between colors, I have set the color as green which you can change as per your requirements.

var pres = new Presentation(@“D:\33164.pptx”);<o:p></o:p>

ITable table = ((Table)pres.Slides[0].Shapes[0]);

ICell cell = table[5 ,2];

var cellLeftBorderColor = table[1, 1].BorderLeft.FillFormat.SolidFillColor.Color;

var initialRightborderCell = cell.BorderRight;

Console.WriteLine("Cell's right border FillType is {0}", initialRightborderCell.FillFormat.FillType);

Console.WriteLine("Cell's right border SolidFillColor is {0}", initialRightborderCell.FillFormat.SolidFillColor);

initialRightborderCell.DashStyle = LineDashStyle.Solid;

initialRightborderCell.Style = LineStyle.Single;

initialRightborderCell.FillFormat.FillType = FillType.Solid;

initialRightborderCell.FillFormat.SolidFillColor.Color = Color.Green;// cellLeftBorderColor;

initialRightborderCell.Width = 1;

pres.Save(@"D:\33164out.pptx", SaveFormat.Pptx);


Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

Hi Adnan,

I copied your code and tried but the issue is still present.
The right border of the cell from 6th row and 3rd column should be green in the resulted file but it’s not (please see the attached screenshot).
What version of MS Office are you using to open the file ?
I tried here with Office 2010 & 2013 but that border is still white.

Regards,
Aurelian Iordache
Software Developer
IBM Romania

Hi Adnan,

I found the issue, your code is using “table[5, 2]” while my code is using “table.Rows[5][2]”, we are testing on different cells :slight_smile:
The cell I’m using in my code is the one having value “-32” and is located on the row 5 and column 2 (0-based indexes).
Could you please check again using the right-side border of that cell ?

Thanks,
Aurelian Iordache
Software Developer
IBM Romania

Hi Aurelian,


I have observed your comments and worked with the code and presentation file shared by you. I have been able to observe the issue, as for some cells the code works and for some cells it does not. A ticket with ID SLIDESNET-36957 has been logged into our issue management system for further investigation and resolution of the issue. This thread has been linked with the issue so that you may be notified automatically as soon as the issue will be fixed.

We are sorry for your inconvenience,

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


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