The addShapeInRange function is established to create a shape by coping to encircle cell range. Only XSSF(xlsx,xlsm).
var excel = new Excel("test.xlsx");
excel.createSheet("newSheet")
.addShapeInRange("newSheet","firstCellPosition","lastCellPosition","templateSheet","shapeName")
.addShapeInRange("newSheet","firstCellPosition","lastCellPosition","templateSheet","shapeName","text")
.addShapeInRange("newSheet","firstCellPosition","lastCellPosition","templateSheet","shapeName","text",20,20,40,40); // To create a shape like line by copying templateSheet's
Calling | Returning |
Excel . addShapeInRange ( sheetName , firstCellPosition , lastCellPosition , templateSheetName , templateShapeName) | Excel |
Excel . addShapeInRange ( sheetName , firstCellPosition , lastCellPosition , templateSheetName , templateShapeName , text) | Excel |
Excel . addShapeInRange ( sheetName , firstCellPosition , lastCellPosition , templateSheetName , templateShapeName , text , x1 , y1 , x2 , y2) | Excel |
Parameters | Type | Description |
sheetName | String | The sheet name. |
firstCellPosition | String | The absolute reference of the first cell. |
lastCellPosition | String | The absolute reference of the last cell. |
templateSheetName | String | The template sheet name. |
templateShapeName | String | The name of the copied shape. |
text | String | The created shape's text value. |
x1 | Number | The x coordinate within the first cell. |
y1 | Number | The y coordinate within the first cell. |
x2 | Number | The x coordinate within the last cell. |
y2 | Number | The y coordinate within the last cell. |