Create line shape in excel

Hi,

I am using aspose excel 7.0.2 for java.

I want create a line shape in my worksheet given the startRow, endRow, startColumn and endColumn.

I know I can create the shape by providing height and rotation angle w.r.t my previous post <a href=".

But in my new requirement I can’t calculate the rotation angle and height. I have to create the line shape with given inputs. Is there any way I can achieve my goal?

I tried to set the topLeftRow/Column and bottomRightRow/Column attributes; but they didn’t turn out to be helpful.

Please let me know.
Thanks!!

Hi,


I think you need to draw the line without specifying the rotation angle and other attributes etc. I have logged a ticket with an id “CELLSJAVA-40538” for your request. We will look into your desired feature if we can support it.

Once we have any update on it, we will let you know here.

Thank you.
Hi,

Thanks for using Aspose.Cells.

Please calculate width and height with the following code. It should fix your issue.

Java
int height = 0;
int startRow = 2;
int endRow = 4;

for (int row = startRow; row <= endRow; row++) {
height += cells.getRowHeightPixel(row);
}

int width = 0;
int startColumn = 2;
int endcolumn = 4;

for (int column = startColumn; column <= endcolumn; column++) {
width += cells.getColumnWidthPixel(column);
}