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

Free Support Forum - aspose.com

Polygon Shape

Hi,


is it possible to create a polygon shape using Aspose.Cells Java?

Thanks!
Manfred

Hi,


Please see the sample code for your reference:
e.g
Sample code:

//Instantiate a new Workbook.
Workbook excelbook = new Workbook();

//Add the shape.
Shape shape = excelbook.getWorksheets().get(0).getShapes().addShape(MsoDrawingType.POLYGON,9,2,0,0,130,130);

//Set the placement of the oval.
shape.setPlacement(PlacementType.FREE_FLOATING);

//Set the line style.
MsoLineFormat lineformat1 = shape.getLineFormat();
lineformat1.setStyle(MsoLineStyle.SINGLE);

//Set the line weight.
lineformat1.setWeight(1);

//Set the color of the oval line.
lineformat1.setForeColor(Color.getBlue());

//Set the dash style of the oval.
lineformat1.setDashStyle(MsoLineDashStyle.SOLID);

//Save the excel file.
excelbook.save(“out1.xls”);

If you still could not evaluate kindly create your desired shape in MS Excel manually and save the file to post us here, we will check it how to do it via Aspose.Cells APIs.

Moreover, please see the document on how to create different controls via Aspose.Cells APIs:
http://www.aspose.com/docs/display/cellsjava/Working+with+Controls


Thank you.