aspose.cells.node.samples 25.4.0 → 25.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +37 -38
  2. package/package.json +2 -2
  3. package/src/samples.js +708 -708
package/src/samples.js CHANGED
@@ -4,17 +4,17 @@ function sampleStyle() {
4
4
 
5
5
  var excel = new Workbook();
6
6
  var style = excel.createStyle();
7
- style.getFont().setName("Times New Roman");
8
- style.getFont().setColor(Color.Blue);
7
+ style.font.setName("Times New Roman");
8
+ style.font.setColor(Color.Blue);
9
9
  for (var i = 0; i < 100; i++) {
10
- excel.getWorksheets().get(0).getCells().get(0, i).setStyle(style);
10
+ excel.worksheets.get(0).cells.get(0, i).setStyle(style);
11
11
  }
12
12
 
13
13
  //Second method
14
- var style1 = excel.getWorksheets().get(0).getCells().get("A1").getStyle();
15
- style1.getFont().setName("Times New Roman");
16
- style1.getFont().setColor(Color.Blue);
17
- excel.getWorksheets().get(0).getCells().get("A1").setStyle(style1);
14
+ var style1 = excel.worksheets.get(0).cells.get("A1").getStyle();
15
+ style1.font.setName("Times New Roman");
16
+ style1.font.color = Color.Blue;
17
+ excel.worksheets.get(0).cells.get("A1").setStyle(style1);
18
18
 
19
19
  //First method is a fast and efficient way to change several cell-formatting properties on multiple cells at the same time.
20
20
  //If you want to change a single cell's style properties, second method can be used.
@@ -25,18 +25,18 @@ function sampleChartTitle() {
25
25
  const { Workbook, Color, ChartType } = require("aspose.cells.node");
26
26
 
27
27
  var excel = new Workbook();
28
- var charts = excel.getWorksheets().get(0).getCharts();
28
+ var charts = excel.worksheets.get(0).charts;
29
29
  //Create a chart
30
30
  var chart = charts.get(charts.add(ChartType.Column, 1, 1, 10, 10));
31
31
 
32
32
  //Setting the title of a chart
33
- chart.getTitle().setText("Title");
33
+ chart.title.text = "Title";
34
34
  //Setting the font color of the chart title to blue
35
- chart.getTitle().getFont().setColor(Color.Blue);
35
+ chart.title.getFont().color = Color.Blue;
36
36
  //Setting the title of category axis of the chart
37
- chart.getCategoryAxis().getTitle().setText("Category");
37
+ chart.categoryAxis.title.text = "Category";
38
38
  //Setting the title of value axis of the chart
39
- chart.getValueAxis().getTitle().setText("Value");
39
+ chart.valueAxis.title.text = "Value";
40
40
  }
41
41
  sampleChartTitle();
42
42
 
@@ -44,7 +44,7 @@ function sampleTablesListObject() {
44
44
  const { Workbook, CellsHelper, TotalsCalculation } = require("aspose.cells.node");
45
45
 
46
46
  var workbook = new Workbook();
47
- var cells = workbook.getWorksheets().get(0).getCells();
47
+ var cells = workbook.worksheets.get(0).cells;
48
48
  for (var i = 0; i < 5; i++) {
49
49
  cells.get(0, i).putValue(CellsHelper.columnIndexToName(i));
50
50
  }
@@ -53,11 +53,11 @@ function sampleTablesListObject() {
53
53
  cells.get(row, column).putValue(row * column);
54
54
  }
55
55
  }
56
- var tables = workbook.getWorksheets().get(0).getListObjects();
56
+ var tables = workbook.worksheets.get(0).getListObjects();
57
57
  var index = tables.add(0, 0, 9, 4, true);
58
58
  var table = tables.get(0);
59
- table.setShowTotals(true);
60
- table.getListColumns().get(4).setTotalsCalculation(TotalsCalculation.Sum);
59
+ table.showTotals = true;
60
+ table.listColumns.get(4).totalsCalculation = TotalsCalculation.Sum;
61
61
  workbook.save("output/Book1.xlsx");
62
62
  }
63
63
  sampleTablesListObject();
@@ -66,13 +66,13 @@ function sampleDrawingFormat() {
66
66
  const { Workbook, ChartType, Color, GradientStyleType } = require("aspose.cells.node");
67
67
 
68
68
  var excel = new Workbook();
69
- var charts = excel.getWorksheets().get(0).getCharts();
69
+ var charts = excel.worksheets.get(0).charts;
70
70
  //Create a chart
71
71
  var chart = charts.get(charts.add(ChartType.Column, 1, 1, 10, 10));
72
- chart.getNSeries().add("A1:C5", true);
72
+ chart.nSeries.add("A1:C5", true);
73
73
 
74
74
  //Filling the area of the 2nd NSeries with a gradient
75
- chart.getNSeries().get(1).getArea().getFillFormat().setOneColorGradient(Color.Lime, 1, GradientStyleType.Horizontal, 1);
75
+ chart.nSeries.get(1).area.fillFormat.setOneColorGradient(Color.Lime, 1, GradientStyleType.Horizontal, 1);
76
76
  }
77
77
  sampleDrawingFormat();
78
78
 
@@ -83,7 +83,7 @@ function samplePropertiesCustomDocumentPropertyCollection() {
83
83
  var workbook = new Workbook("input/CustomProperties.xlsx");
84
84
 
85
85
  //Retrieve a list of all custom document properties of the Excel file
86
- var customProperties = workbook.getWorksheets().getCustomDocumentProperties();
86
+ var customProperties = workbook.worksheets.customDocumentProperties;
87
87
  }
88
88
  samplePropertiesCustomDocumentPropertyCollection();
89
89
 
@@ -94,7 +94,7 @@ function samplePropertyDocumentPropertyCollection() {
94
94
  var workbook = new Workbook("input/CustomProperties.xlsx");
95
95
 
96
96
  //Retrieve a list of all custom document properties of the Excel file
97
- var customProperties = workbook.getWorksheets().getCustomDocumentProperties();
97
+ var customProperties = workbook.worksheets.customDocumentProperties;
98
98
 
99
99
  //Accessng a custom document property by using the property index
100
100
  var customProperty1 = customProperties.get(3);
@@ -102,7 +102,7 @@ function samplePropertyDocumentPropertyCollection() {
102
102
  //Accessng a custom document property by using the property name
103
103
  var customProperty2 = customProperties.get("rox_Meta1");
104
104
 
105
- console.log("Custom Properties: " + customProperties.getCount());
105
+ console.log("Custom Properties: " + customProperties.count);
106
106
  }
107
107
  samplePropertyDocumentPropertyCollection();
108
108
 
@@ -112,12 +112,12 @@ function sampleDrawingPicture() {
112
112
  //Instantiating a Workbook object
113
113
  var workbook = new Workbook();
114
114
  //Adding a new worksheet to the Workbook object
115
- var sheetIndex = workbook.getWorksheets().add();
115
+ var sheetIndex = workbook.worksheets.add();
116
116
  //Obtaining the reference of the newly added worksheet by passing its sheet index
117
- var worksheet = workbook.getWorksheets().get(sheetIndex);
117
+ var worksheet = workbook.worksheets.get(sheetIndex);
118
118
  //Adding a picture at the location of a cell whose row and column indices
119
119
  //are 5 in the worksheet. It is "F6" cell
120
- worksheet.getPictures().add(5, 5, "input/image.gif");
120
+ worksheet.pictures.add(5, 5, "input/image.gif");
121
121
  //Saving the Excel file
122
122
  workbook.save("output/Book1.xls", SaveFormat.Excel97To2003);
123
123
  }
@@ -130,13 +130,13 @@ function sampleHorizontalPageBreak() {
130
130
  var workbook = new Workbook();
131
131
 
132
132
  //Obtaining the reference of the newly added worksheet by passing its sheet index
133
- var worksheet = workbook.getWorksheets().get(0);
133
+ var worksheet = workbook.worksheets.get(0);
134
134
 
135
135
  //Add a page break at cell Y30
136
- var Index = worksheet.getHorizontalPageBreaks().add("Y30");
136
+ var Index = worksheet.horizontalPageBreaks.add("Y30");
137
137
 
138
138
  //get the newly added horizontal page break
139
- var hPageBreak = worksheet.getHorizontalPageBreaks().get(Index);
139
+ var hPageBreak = worksheet.horizontalPageBreaks.get(Index);
140
140
  }
141
141
  sampleHorizontalPageBreak();
142
142
 
@@ -150,29 +150,29 @@ function sampleChartsFloor() {
150
150
  //Instantiate the workbook object
151
151
  var workbook = new Workbook();
152
152
  //Get cells collection
153
- var cells = workbook.getWorksheets().get(0).getCells();
153
+ var cells = workbook.worksheets.get(0).cells;
154
154
  //Put values in cells
155
155
  cells.get("A1").putValue(1);
156
156
  cells.get("A2").putValue(2);
157
157
  cells.get("A3").putValue(3);
158
158
 
159
159
  //get charts colletion
160
- var charts = workbook.getWorksheets().get(0).getCharts();
160
+ var charts = workbook.worksheets.get(0).charts;
161
161
  //add a new chart
162
162
  var index = charts.add(ChartType.Column3DStacked, 5, 0, 15, 5);
163
163
  //get the newly added chart
164
164
  var chart = charts.get(index);
165
165
  //set charts nseries
166
- chart.getNSeries().add("A1:A3", true);
166
+ chart.nSeries.add("A1:A3", true);
167
167
  //Show data labels
168
- chart.getNSeries().get(0).getDataLabels().setShowValue(true);
168
+ chart.nSeries.get(0).dataLabels.showValue = true;
169
169
 
170
170
  //Get chart's floor
171
- var floor = chart.getFloor();
171
+ var floor = chart.floor;
172
172
  //set floor's border as red
173
- floor.getBorder().setColor(new Color("red"));
173
+ floor.border.color = new Color("red");
174
174
  //set fill format
175
- floor.getFillFormat().setPresetColorGradient(GradientPresetType.CalmWater, GradientStyleType.DiagonalDown, 2);
175
+ floor.fillFormat.setPresetColorGradient(GradientPresetType.CalmWater, GradientStyleType.DiagonalDown, 2);
176
176
 
177
177
  //save the file
178
178
  workbook.save("output/ChartsFloor.xls");
@@ -185,35 +185,35 @@ function sampleDrawingArea() {
185
185
  //Instantiating a Workbook object
186
186
  var workbook = new Workbook();
187
187
  //Adding a new worksheet to the Workbook object
188
- var sheetIndex = workbook.getWorksheets().add();
188
+ var sheetIndex = workbook.worksheets.add();
189
189
  //Obtaining the reference of the newly added worksheet by passing its sheet index
190
- var worksheet = workbook.getWorksheets().get(sheetIndex);
190
+ var worksheet = workbook.worksheets.get(sheetIndex);
191
191
  //Adding a sample value to "A1" cell
192
- worksheet.getCells().get("A1").putValue(50);
192
+ worksheet.cells.get("A1").putValue(50);
193
193
  //Adding a sample value to "A2" cell
194
- worksheet.getCells().get("A2").putValue(100);
194
+ worksheet.cells.get("A2").putValue(100);
195
195
  //Adding a sample value to "A3" cell
196
- worksheet.getCells().get("A3").putValue(150);
196
+ worksheet.cells.get("A3").putValue(150);
197
197
  //Adding a sample value to "B1" cell
198
- worksheet.getCells().get("B1").putValue(60);
198
+ worksheet.cells.get("B1").putValue(60);
199
199
  //Adding a sample value to "B2" cell
200
- worksheet.getCells().get("B2").putValue(32);
200
+ worksheet.cells.get("B2").putValue(32);
201
201
  //Adding a sample value to "B3" cell
202
- worksheet.getCells().get("B3").putValue(50);
202
+ worksheet.cells.get("B3").putValue(50);
203
203
  //Adding a chart to the worksheet
204
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
204
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
205
205
  //Accessing the instance of the newly added chart
206
- var chart = worksheet.getCharts().get(chartIndex);
206
+ var chart = worksheet.charts.get(chartIndex);
207
207
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
208
- chart.getNSeries().add("A1:B3", true);
208
+ chart.nSeries.add("A1:B3", true);
209
209
  //Setting the foreground color of the plot area
210
- chart.getPlotArea().getArea().setForegroundColor(Color.Blue);
210
+ chart.plotArea.getArea().foregroundColor = Color.Blue;
211
211
  //Setting the foreground color of the chart area
212
- chart.getChartArea().getArea().setForegroundColor(Color.Yellow);
212
+ chart.chartArea.getArea().foregroundColor = Color.Yellow;
213
213
  //Setting the foreground color of the 1st NSeries area
214
- chart.getNSeries().get(0).getArea().setForegroundColor(Color.Red);
214
+ chart.nSeries.get(0).area.foregroundColor = Color.Red;
215
215
  //Setting the foreground color of the area of the 1st NSeries point
216
- chart.getNSeries().get(0).getPoints().get(0).getArea().setForegroundColor(Color.Cyan);
216
+ chart.nSeries.get(0).points.get(0).area.foregroundColor = Color.Cyan;
217
217
  //Saving the Excel file
218
218
  workbook.save("output/DrawingArea.xls");
219
219
  }
@@ -225,27 +225,27 @@ function sampleDrawingAreaInverseIfNegative() {
225
225
  //Instantiating a Workbook object
226
226
  var workbook = new Workbook();
227
227
  //Adding a new worksheet to the Workbook object
228
- var sheetIndex = workbook.getWorksheets().add();
228
+ var sheetIndex = workbook.worksheets.add();
229
229
  //Obtaining the reference of the newly added worksheet by passing its sheet index
230
- var worksheet = workbook.getWorksheets().get(sheetIndex);
230
+ var worksheet = workbook.worksheets.get(sheetIndex);
231
231
  //Adding a sample value to "A1" cell
232
- worksheet.getCells().get("A1").putValue(50);
232
+ worksheet.cells.get("A1").putValue(50);
233
233
  //Adding a sample value to "A2" cell
234
- worksheet.getCells().get("A2").putValue(-100);
234
+ worksheet.cells.get("A2").putValue(-100);
235
235
  //Adding a sample value to "A3" cell
236
- worksheet.getCells().get("A3").putValue(150);
236
+ worksheet.cells.get("A3").putValue(150);
237
237
  //Adding a chart to the worksheet
238
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
238
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
239
239
  //Accessing the instance of the newly added chart
240
- var chart = worksheet.getCharts().get(chartIndex);
240
+ var chart = worksheet.charts.get(chartIndex);
241
241
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "A3"
242
- chart.getNSeries().add("A1:A3", true);
243
- chart.getNSeries().get(0).getArea().setInvertIfNegative(true);
242
+ chart.nSeries.add("A1:A3", true);
243
+ chart.nSeries.get(0).area.invertIfNegative = true;
244
244
  //Setting the foreground color of the 1st NSeries area
245
- chart.getNSeries().get(0).getArea().setForegroundColor(Color.Red);
245
+ chart.nSeries.get(0).area.foregroundColor = Color.Red;
246
246
  //Setting the background color of the 1st NSeries area.
247
247
  //The displayed area color of second chart point will be the background color.
248
- chart.getNSeries().get(0).getArea().setBackgroundColor(Color.Yellow);
248
+ chart.nSeries.get(0).area.backgroundColor = Color.Yellow;
249
249
  //Saving the Excel file
250
250
  workbook.save("output/DrawingAreaInverseIfNegative.xls");
251
251
  }
@@ -258,9 +258,9 @@ function sampleExternlink() {
258
258
  var workbook = new Workbook("input/Externlink.xls");
259
259
 
260
260
  //Get External Link
261
- var externalLink = workbook.getWorksheets().getExternalLinks().get(0);
261
+ var externalLink = workbook.worksheets.externalLinks.get(0);
262
262
  //Change External Link's Data Source
263
- externalLink.setDataSource("input/Book1.xls");
263
+ externalLink.dataSource = "input/Book1.xls";
264
264
  }
265
265
  sampleExternlink();
266
266
 
@@ -268,18 +268,18 @@ function sampleComment() {
268
268
  const { Workbook } = require("aspose.cells.node");
269
269
 
270
270
  var workbook = new Workbook();
271
- var comments = workbook.getWorksheets().get(0).getComments();
271
+ var comments = workbook.worksheets.get(0).comments;
272
272
 
273
273
  //Add comment to cell A1
274
274
  var commentIndex = comments.add(0, 0);
275
275
  var comment = comments.get(commentIndex);
276
- comment.setNote("First note.");
277
- comment.getFont().setName("Times New Roman");
276
+ comment.note = "First note.";
277
+ comment.font.setName("Times New Roman");
278
278
 
279
279
  //Add comment to cell B2
280
280
  comments.add("B2");
281
281
  comment = comments.get("B2");
282
- comment.setNote("Second note.");
282
+ comment.note = "Second note.";
283
283
  }
284
284
  sampleComment();
285
285
 
@@ -288,11 +288,11 @@ function sampleIconSet() {
288
288
 
289
289
  //Instantiating a Workbook object
290
290
  var workbook = new Workbook();
291
- var sheet = workbook.getWorksheets().get(0);
291
+ var sheet = workbook.worksheets.get(0);
292
292
 
293
293
  //Adds an empty conditional formatting
294
- var index = sheet.getConditionalFormattings().add();
295
- var fcs = sheet.getConditionalFormattings().get(index);
294
+ var index = sheet.conditionalFormattings.add();
295
+ var fcs = sheet.conditionalFormattings.get(index);
296
296
  //Sets the conditional format range.
297
297
  var ca = new CellArea();
298
298
  ca.startRow = 0;
@@ -307,16 +307,16 @@ function sampleIconSet() {
307
307
  fcs.addArea(ca);
308
308
  var cond = fcs.get(idx);
309
309
  //Get Icon Set
310
- var iconSet = cond.getIconSet();
310
+ var iconSet = cond.iconSet;
311
311
  //Set Icon Type
312
- iconSet.setType(IconSetType.Arrows3);
312
+ iconSet.type = IconSetType.Arrows3;
313
313
 
314
314
  //Put Cell Values
315
- var cell1 = sheet.getCells().get("A1");
315
+ var cell1 = sheet.cells.get("A1");
316
316
  cell1.putValue(10);
317
- var cell2 = sheet.getCells().get("A2");
317
+ var cell2 = sheet.cells.get("A2");
318
318
  cell2.putValue(120);
319
- var cell3 = sheet.getCells().get("A3");
319
+ var cell3 = sheet.cells.get("A3");
320
320
  cell3.putValue(260);
321
321
 
322
322
  //Saving the Excel file
@@ -328,10 +328,10 @@ function samplePageSetup() {
328
328
  const { Workbook } = require("aspose.cells.node");
329
329
 
330
330
  var workbook = new Workbook();
331
- var sheet = workbook.getWorksheets().get(0);
332
- sheet.getPageSetup().setPrintArea("D1:K13");
333
- sheet.getPageSetup().setPrintTitleRows("$5:$7");
334
- sheet.getPageSetup().setPrintTitleColumns("$A:$B");
331
+ var sheet = workbook.worksheets.get(0);
332
+ sheet.pageSetup.printArea = "D1:K13";
333
+ sheet.pageSetup.printTitleRows = "$5:$7";
334
+ sheet.pageSetup.printTitleColumns = "$A:$B";
335
335
  }
336
336
  samplePageSetup();
337
337
 
@@ -342,15 +342,15 @@ function sampleDrawingOleObject() {
342
342
  //Instantiate a new Workbook.
343
343
  var workbook = new Workbook();
344
344
  //Get the first worksheet.
345
- var sheet = workbook.getWorksheets().get(0);
345
+ var sheet = workbook.worksheets.get(0);
346
346
 
347
347
  //Obtain the picture into the array of bytes from a stream.
348
348
  var imgBuf = new Uint8Array(fs.readFileSync("input/example.png"));
349
349
  //Add an Ole object into the worksheet with the bytes
350
- sheet.getOleObjects().add(14, 3, 200, 220, imgBuf);
350
+ sheet.oleObjects.add(14, 3, 200, 220, imgBuf);
351
351
  //Set embedded ole object data from a stream.
352
352
  var fileBuf = new Uint8Array(fs.readFileSync("input/Book1.xls"));
353
- sheet.getOleObjects().get(0).setObjectData(fileBuf);
353
+ sheet.oleObjects.get(0).objectData = fileBuf;
354
354
  //Save the excel file
355
355
  workbook.save("output/DrawingOleObject.xls");
356
356
  }
@@ -361,9 +361,9 @@ function sampleTextEffectFormat() {
361
361
 
362
362
  //Instantiating a Workbook object
363
363
  var workbook = new Workbook();
364
- var shapes = workbook.getWorksheets().get(0).getShapes();
364
+ var shapes = workbook.worksheets.get(0).shapes;
365
365
  shapes.addTextEffect(MsoPresetTextEffect.TextEffect1, "Aspose", "Arial", 30, false, false, 0, 0, 0, 0, 100, 200);
366
- var textEffectFormat = shapes.get(0).getTextEffect();
366
+ var textEffectFormat = shapes.get(0).textEffect;
367
367
  textEffectFormat.setTextEffect(MsoPresetTextEffect.TextEffect10);
368
368
  workbook.save("output/TextEffectFormat.xls");
369
369
  }
@@ -373,7 +373,7 @@ function sampleChartsErrorBar() {
373
373
  const { Workbook, ChartType, ErrorBarDisplayType, ErrorBarType } = require("aspose.cells.node");
374
374
 
375
375
  var workbook = new Workbook();
376
- var cells = workbook.getWorksheets().get(0).getCells();
376
+ var cells = workbook.worksheets.get(0).cells;
377
377
  cells.get("a1").putValue(2);
378
378
  cells.get("a2").putValue(5);
379
379
  cells.get("a3").putValue(3);
@@ -388,16 +388,16 @@ function sampleChartsErrorBar() {
388
388
  cells.get("C3").putValue("Y1");
389
389
  cells.get("C4").putValue("Y2");
390
390
 
391
- var chartIndex = workbook.getWorksheets().get(0).getCharts().add(ChartType.Column, 11, 0, 27, 10);
392
- var chart = workbook.getWorksheets().get(0).getCharts().get(chartIndex);
393
- chart.getNSeries().add("A1:B4", true);
394
- chart.getNSeries().setCategoryData("C1:C4");
395
-
396
- for (var i = 0; i < chart.getNSeries().getCount(); i++) {
397
- var aseries = chart.getNSeries().get(i);
398
- aseries.getXErrorBar().setDisplayType(ErrorBarDisplayType.Minus);
399
- aseries.getXErrorBar().setType(ErrorBarType.FixedValue);
400
- aseries.getXErrorBar().setAmount(5);
391
+ var chartIndex = workbook.worksheets.get(0).charts.add(ChartType.Column, 11, 0, 27, 10);
392
+ var chart = workbook.worksheets.get(0).charts.get(chartIndex);
393
+ chart.nSeries.add("A1:B4", true);
394
+ chart.nSeries.categoryData = "C1:C4";
395
+
396
+ for (var i = 0; i < chart.nSeries.count; i++) {
397
+ var aseries = chart.nSeries.get(i);
398
+ aseries.xErrorBar.displayType = ErrorBarDisplayType.Minus;
399
+ aseries.xErrorBar.type = ErrorBarType.FixedValue;
400
+ aseries.xErrorBar.amount = 5;
401
401
  }
402
402
  }
403
403
  sampleChartsErrorBar();
@@ -406,7 +406,7 @@ function sampleDrawingLine() {
406
406
  const { Workbook, ChartType, LineType, ChartMarkerType, WeightType } = require("aspose.cells.node");
407
407
 
408
408
  var workbook = new Workbook();
409
- var cells = workbook.getWorksheets().get(0).getCells();
409
+ var cells = workbook.worksheets.get(0).cells;
410
410
  cells.get("a1").putValue(2);
411
411
  cells.get("a2").putValue(5);
412
412
  cells.get("a3").putValue(3);
@@ -415,15 +415,15 @@ function sampleDrawingLine() {
415
415
  cells.get("b2").putValue(3);
416
416
  cells.get("b3").putValue(6);
417
417
  cells.get("b4").putValue(7);
418
- var chartIndex = workbook.getWorksheets().get(0).getCharts().add(ChartType.Column, 11, 0, 27, 10);
419
- var chart = workbook.getWorksheets().get(0).getCharts().get(chartIndex);
420
- chart.getNSeries().add("A1:B4", true);
418
+ var chartIndex = workbook.worksheets.get(0).charts.add(ChartType.Column, 11, 0, 27, 10);
419
+ var chart = workbook.worksheets.get(0).charts.get(chartIndex);
420
+ chart.nSeries.add("A1:B4", true);
421
421
  //Applying a dotted line style on the lines of an NSeries
422
- chart.getNSeries().get(0).getBorder().setStyle(LineType.Dot);
422
+ chart.nSeries.get(0).border.style = LineType.Dot;
423
423
  //Applying a triangular marker style on the data markers of an NSeries
424
- chart.getNSeries().get(0).getMarker().setMarkerStyle(ChartMarkerType.Triangle);
424
+ chart.nSeries.get(0).marker.markerStyle = ChartMarkerType.Triangle;
425
425
  //Setting the weight of all lines in an NSeries to medium
426
- chart.getNSeries().get(0).getBorder().setWeight(WeightType.MediumLine);
426
+ chart.nSeries.get(0).border.weight = WeightType.MediumLine;
427
427
  }
428
428
  sampleDrawingLine();
429
429
 
@@ -431,7 +431,7 @@ function sampleChartsErrorBarType() {
431
431
  const { Workbook, ChartType, ErrorBarType } = require("aspose.cells.node");
432
432
 
433
433
  var workbook = new Workbook();
434
- var cells = workbook.getWorksheets().get(0).getCells();
434
+ var cells = workbook.worksheets.get(0).cells;
435
435
  cells.get("a1").putValue(2);
436
436
  cells.get("a2").putValue(5);
437
437
  cells.get("a3").putValue(3);
@@ -446,17 +446,17 @@ function sampleChartsErrorBarType() {
446
446
  cells.get("C3").putValue("Y1");
447
447
  cells.get("C4").putValue("Y2");
448
448
 
449
- var chartIndex = workbook.getWorksheets().get(0).getCharts().add(ChartType.Column, 11, 0, 27, 10);
450
- var chart = workbook.getWorksheets().get(0).getCharts().get(chartIndex);
451
- chart.getNSeries().add("A1:B4", true);
452
- chart.getNSeries().setCategoryData("C1:C4");
449
+ var chartIndex = workbook.worksheets.get(0).charts.add(ChartType.Column, 11, 0, 27, 10);
450
+ var chart = workbook.worksheets.get(0).charts.get(chartIndex);
451
+ chart.nSeries.add("A1:B4", true);
452
+ chart.nSeries.categoryData = "C1:C4";
453
453
 
454
- for (var i = 0; i < chart.getNSeries().getCount(); i++) {
455
- var aseries = chart.getNSeries().get(i);
454
+ for (var i = 0; i < chart.nSeries.count; i++) {
455
+ var aseries = chart.nSeries.get(i);
456
456
  //Sets custom error bar type
457
- aseries.getXErrorBar().setType(ErrorBarType.Custom);
458
- aseries.getXErrorBar().setPlusValue("=Sheet1!A1");
459
- aseries.getXErrorBar().setMinusValue("=Sheet1!A2");
457
+ aseries.xErrorBar.type = ErrorBarType.Custom;
458
+ aseries.xErrorBar.plusValue = "=Sheet1!A1";
459
+ aseries.xErrorBar.minusValue = "=Sheet1!A2";
460
460
  }
461
461
  }
462
462
  sampleChartsErrorBarType();
@@ -467,21 +467,21 @@ function sampleDrawingButton() {
467
467
  //Create a new Workbook.
468
468
  var workbook = new Workbook();
469
469
  //Get the first worksheet in the workbook.
470
- var sheet = workbook.getWorksheets().get(0);
470
+ var sheet = workbook.worksheets.get(0);
471
471
 
472
472
  //Add a new button to the worksheet.
473
- var button = sheet.getShapes().addShape(MsoDrawingType.Button, 2, 0, 2, 0, 28, 80);
473
+ var button = sheet.shapes.addShape(MsoDrawingType.Button, 2, 0, 2, 0, 28, 80);
474
474
  //Set the caption of the button.
475
- button.setText("Aspose");
475
+ button.text = "Aspose";
476
476
  //Set the Placement Type, the way the
477
477
  //button is attached to the cells.
478
- button.setPlacement(PlacementType.FreeFloating);
478
+ button.placement = PlacementType.FreeFloating;
479
479
  //Set the font name.
480
- button.getFont().setName("Tahoma");
480
+ button.font.setName("Tahoma");
481
481
  //Set the caption string bold.
482
- button.getFont().setIsBold(true);
482
+ button.font.isBold = true;
483
483
  //Set the color to blue.
484
- button.getFont().setColor(Color.Blue);
484
+ button.font.color = Color.Blue;
485
485
  //Set the hyperlink for the button.
486
486
  button.addHyperlink("http://www.aspose.com/");
487
487
 
@@ -494,11 +494,11 @@ function sampleValidation() {
494
494
  const { Workbook, ValidationType, CellArea } = require("aspose.cells.node");
495
495
 
496
496
  var workbook = new Workbook();
497
- var validations = workbook.getWorksheets().get(0).getValidations();
497
+ var validations = workbook.worksheets.get(0).validations;
498
498
  var area = CellArea.createCellArea(0, 0, 1, 1);
499
499
  var validation = validations.get(validations.add(area));
500
- validation.setType(ValidationType.List);
501
- validation.setFormula1("a,b,c,d");
500
+ validation.type = ValidationType.List;
501
+ validation.formula1 = "a,b,c,d";
502
502
  }
503
503
  sampleValidation();
504
504
 
@@ -508,41 +508,41 @@ function sampleChartsSeriesCollection() {
508
508
  //Instantiating a Workbook object
509
509
  var workbook = new Workbook();
510
510
  //Adding a new worksheet to the Excel object
511
- var sheetIndex = workbook.getWorksheets().add();
511
+ var sheetIndex = workbook.worksheets.add();
512
512
  //Obtaining the reference of the newly added worksheet by passing its sheet index
513
- var worksheet = workbook.getWorksheets().get(sheetIndex);
513
+ var worksheet = workbook.worksheets.get(sheetIndex);
514
514
  //Adding a sample value to "A1" cell
515
- worksheet.getCells().get("A1").putValue(50);
515
+ worksheet.cells.get("A1").putValue(50);
516
516
  //Adding a sample value to "A2" cell
517
- worksheet.getCells().get("A2").putValue(100);
517
+ worksheet.cells.get("A2").putValue(100);
518
518
  //Adding a sample value to "A3" cell
519
- worksheet.getCells().get("A3").putValue(150);
519
+ worksheet.cells.get("A3").putValue(150);
520
520
  //Adding a sample value to "A4" cell
521
- worksheet.getCells().get("A4").putValue(200);
521
+ worksheet.cells.get("A4").putValue(200);
522
522
  //Adding a sample value to "B1" cell
523
- worksheet.getCells().get("B1").putValue(60);
523
+ worksheet.cells.get("B1").putValue(60);
524
524
  //Adding a sample value to "B2" cell
525
- worksheet.getCells().get("B2").putValue(32);
525
+ worksheet.cells.get("B2").putValue(32);
526
526
  //Adding a sample value to "B3" cell
527
- worksheet.getCells().get("B3").putValue(50);
527
+ worksheet.cells.get("B3").putValue(50);
528
528
  //Adding a sample value to "B4" cell
529
- worksheet.getCells().get("B4").putValue(40);
529
+ worksheet.cells.get("B4").putValue(40);
530
530
  //Adding a sample value to "C1" cell as category data
531
- worksheet.getCells().get("C1").putValue("Q1");
531
+ worksheet.cells.get("C1").putValue("Q1");
532
532
  //Adding a sample value to "C2" cell as category data
533
- worksheet.getCells().get("C2").putValue("Q2");
533
+ worksheet.cells.get("C2").putValue("Q2");
534
534
  //Adding a sample value to "C3" cell as category data
535
- worksheet.getCells().get("C3").putValue("Y1");
535
+ worksheet.cells.get("C3").putValue("Y1");
536
536
  //Adding a sample value to "C4" cell as category data
537
- worksheet.getCells().get("C4").putValue("Y2");
537
+ worksheet.cells.get("C4").putValue("Y2");
538
538
  //Adding a chart to the worksheet
539
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
539
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
540
540
  //Accessing the instance of the newly added chart
541
- var chart = worksheet.getCharts().get(chartIndex);
541
+ var chart = worksheet.charts.get(chartIndex);
542
542
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
543
- chart.getNSeries().add("A1:B4", true);
543
+ chart.nSeries.add("A1:B4", true);
544
544
  //Setting the data source for the category data of NSeries
545
- chart.getNSeries().setCategoryData("C1:C4");
545
+ chart.nSeries.categoryData = "C1:C4";
546
546
  //Saving the Excel file
547
547
  workbook.save("output/ChartsSeriesCollection.xls");
548
548
  }
@@ -554,12 +554,12 @@ function sampleHyperlinkCollection() {
554
554
  //Instantiating a Workbook object
555
555
  var workbook = new Workbook();
556
556
  //Obtaining the reference of the newly added worksheet by passing its sheet index
557
- var worksheet = workbook.getWorksheets().get(0);
557
+ var worksheet = workbook.worksheets.get(0);
558
558
 
559
559
  //Get Hyperlinks Collection
560
- var hyperlinks = worksheet.getHyperlinks();
560
+ var hyperlinks = worksheet.hyperlinks;
561
561
  //Adding a hyperlink to a URL at "A1" cell
562
- hyperlinks.add("A1", 1, 1, "http://www.aspose.com");
562
+ hyperlinks.add("A1", 1, 1, "https://www.aspose.com");
563
563
 
564
564
  //Saving the Excel file
565
565
  workbook.save("output/HyperlinkCollection.xls");
@@ -570,9 +570,9 @@ function sampleHyperlinkCollectionAddIntIntIntIntString() {
570
570
  const { Workbook } = require("aspose.cells.node");
571
571
 
572
572
  var excel = new Workbook();
573
- var worksheet = excel.getWorksheets().get(0);
574
- worksheet.getHyperlinks().add("A4", 1, 1, "http://www.aspose.com");
575
- worksheet.getHyperlinks().add("A5", 1, 1, "c:\\book1.xls");
573
+ var worksheet = excel.worksheets.get(0);
574
+ worksheet.hyperlinks.add("A4", 1, 1, "https://www.aspose.com");
575
+ worksheet.hyperlinks.add("A5", 1, 1, "c:\\book1.xls");
576
576
  }
577
577
  sampleHyperlinkCollectionAddIntIntIntIntString();
578
578
 
@@ -582,11 +582,11 @@ function sampleDataSorter() {
582
582
  //Instantiate a new Workbook object.
583
583
  var workbook = new Workbook("input/DataSorter.xls");
584
584
  //Get the workbook datasorter object.
585
- var sorter = workbook.getDataSorter();
585
+ var sorter = workbook.dataSorter;
586
586
  //Set the first order for datasorter object.
587
- sorter.setOrder1(SortOrder.Descending);
587
+ sorter.order1 = SortOrder.Descending;
588
588
  //Define the first key.
589
- sorter.setKey1(0);
589
+ sorter.key1 = 0;
590
590
  //Create a cells area (range).
591
591
  var ca = new CellArea();
592
592
  //Specify the start row index.
@@ -598,7 +598,7 @@ function sampleDataSorter() {
598
598
  //Specify the last column index.
599
599
  ca.endColumn = 1;
600
600
  //Sort data in the specified data range (A1:B14)
601
- sorter.sort(workbook.getWorksheets().get(0).getCells(), ca);
601
+ sorter.sort(workbook.worksheets.get(0).cells, ca);
602
602
  //Save the excel file.
603
603
  workbook.save("output/DataSorter.xls");
604
604
  }
@@ -610,23 +610,23 @@ function sampleColumn() {
610
610
  //Instantiating a Workbook object
611
611
  var workbook = new Workbook();
612
612
  //Obtaining the reference of the first worksheet
613
- var worksheet = workbook.getWorksheets().get(0);
613
+ var worksheet = workbook.worksheets.get(0);
614
614
 
615
615
  //Add new Style to Workbook
616
616
  var style = workbook.createStyle();
617
617
  //Setting the background color to Blue
618
- style.setBackgroundColor(Color.Blue);
618
+ style.backgroundColor = Color.Blue;
619
619
  //Setting the foreground color to Red
620
- style.setForegroundColor(Color.Red);
620
+ style.foregroundColor = Color.Red;
621
621
  //setting Background Pattern
622
- style.setPattern(BackgroundType.DiagonalStripe);
622
+ style.pattern = BackgroundType.DiagonalStripe;
623
623
  //New Style Flag
624
624
  var styleFlag = new StyleFlag();
625
625
  //Set All Styles
626
- styleFlag.setAll(true);
626
+ styleFlag.all = true;
627
627
 
628
628
  //Get first Column
629
- var column = worksheet.getCells().getColumns().get(0);
629
+ var column = worksheet.cells.columns.get(0);
630
630
  //Apply Style to first Column
631
631
  column.applyStyle(style, styleFlag);
632
632
 
@@ -651,13 +651,13 @@ function sampleBorder() {
651
651
  const { Workbook, BorderType, CellBorderType, Color } = require("aspose.cells.node");
652
652
 
653
653
  var workbook = new Workbook();
654
- var worksheet = workbook.getWorksheets().get(0);
655
- var cell = worksheet.getCells().get(0, 0);
654
+ var worksheet = workbook.worksheets.get(0);
655
+ var cell = worksheet.cells.get(0, 0);
656
656
  var style = workbook.createStyle();
657
657
  //Set top border style and color
658
- var border = style.getBorders().get(BorderType.TopBorder);
659
- border.setLineStyle(CellBorderType.Medium);
660
- border.setColor(Color.Red);
658
+ var border = style.borders.get(BorderType.TopBorder);
659
+ border.lineStyle = CellBorderType.Medium;
660
+ border.color = Color.Red;
661
661
  cell.setStyle(style);
662
662
  }
663
663
  sampleBorder();
@@ -667,11 +667,11 @@ function sampleDataBar() {
667
667
 
668
668
  //Instantiating a Workbook object
669
669
  var workbook = new Workbook();
670
- var sheet = workbook.getWorksheets().get(0);
670
+ var sheet = workbook.worksheets.get(0);
671
671
 
672
672
  //Adds an empty conditional formatting
673
- var index = sheet.getConditionalFormattings().add();
674
- var fcs = sheet.getConditionalFormattings().get(index);
673
+ var index = sheet.conditionalFormattings.add();
674
+ var fcs = sheet.conditionalFormattings.get(index);
675
675
 
676
676
  //Sets the conditional format range.
677
677
  var ca = new CellArea();
@@ -687,21 +687,21 @@ function sampleDataBar() {
687
687
  var cond = fcs.get(idx);
688
688
 
689
689
  //Get Databar
690
- var dataBar = cond.getDataBar();
690
+ var dataBar = cond.dataBar;
691
691
  var orange = Color.Orange;
692
- dataBar.setColor(orange);
692
+ dataBar.color = orange;
693
693
 
694
694
  //Set Databar properties
695
- dataBar.getMinCfvo().setType(FormatConditionValueType.Percentile);
696
- dataBar.getMinCfvo().setValue(30);
697
- dataBar.setShowValue(false);
695
+ dataBar.minCfvo.type = FormatConditionValueType.Percentile;
696
+ dataBar.minCfvo.value = 30;
697
+ dataBar.showValue = false;
698
698
 
699
699
  //Put Cell Values
700
- var cell1 = sheet.getCells().get("A1");
700
+ var cell1 = sheet.cells.get("A1");
701
701
  cell1.putValue(10);
702
- var cell2 = sheet.getCells().get("A2");
702
+ var cell2 = sheet.cells.get("A2");
703
703
  cell2.putValue(120);
704
- var cell3 = sheet.getCells().get("A3");
704
+ var cell3 = sheet.cells.get("A3");
705
705
  cell3.putValue(260);
706
706
 
707
707
  //Saving the Excel file
@@ -716,8 +716,8 @@ function sampleWorkbook() {
716
716
  var workbook = new Workbook("input/Book1.xls");
717
717
 
718
718
  //Set scroll bars
719
- workbook.getSettings().setIsHScrollBarVisible(false);
720
- workbook.getSettings().setIsVScrollBarVisible(false);
719
+ workbook.settings.isHScrollBarVisible = false;
720
+ workbook.settings.isVScrollBarVisible = false;
721
721
 
722
722
  //Replace the placeholder string with new values
723
723
  workbook.replace("OldInt", 100);
@@ -747,8 +747,8 @@ function sampleWorkbookSaveFileFormatType() {
747
747
  const { Workbook, SaveFormat } = require("aspose.cells.node");
748
748
 
749
749
  var workbook = new Workbook();
750
- var sheets = workbook.getWorksheets();
751
- var cells = sheets.get(0).getCells();
750
+ var sheets = workbook.worksheets;
751
+ var cells = sheets.get(0).cells;
752
752
  cells.get("A1").putValue("Hello world!");
753
753
  workbook.save("output/WorkbookSaveFileFormatType.xls", SaveFormat.Excel97To2003);
754
754
  }
@@ -817,9 +817,9 @@ function sampleWorkbookDefaultStyle() {
817
817
  const { Workbook } = require("aspose.cells.node");
818
818
 
819
819
  var workbook = new Workbook();
820
- var defaultStyle = workbook.getDefaultStyle();
821
- defaultStyle.getFont().setName("Tahoma");
822
- workbook.setDefaultStyle(defaultStyle);
820
+ var defaultStyle = workbook.defaultStyle;
821
+ defaultStyle.font.setName("Tahoma");
822
+ workbook.defaultStyle = defaultStyle;
823
823
  }
824
824
  sampleWorkbookDefaultStyle();
825
825
 
@@ -827,8 +827,8 @@ function sampleWorkbookBuildInDocumentProperties() {
827
827
  const { Workbook } = require("aspose.cells.node");
828
828
 
829
829
  var workbook = new Workbook();
830
- var doc = workbook.getBuiltInDocumentProperties().get("Author");
831
- doc.setValue("John Smith");
830
+ var doc = workbook.builtInDocumentProperties.get("Author");
831
+ doc.value = "John Smith";
832
832
  }
833
833
  sampleWorkbookBuildInDocumentProperties();
834
834
 
@@ -836,7 +836,7 @@ function sampleWorkbookCustomDocumentProperties() {
836
836
  const { Workbook } = require("aspose.cells.node");
837
837
 
838
838
  var excel = new Workbook();
839
- excel.getCustomDocumentProperties().add("Checked by", "Jane");
839
+ excel.customDocumentProperties.add("Checked by", "Jane");
840
840
  }
841
841
  sampleWorkbookCustomDocumentProperties();
842
842
 
@@ -845,14 +845,14 @@ function sampleThemeColor() {
845
845
 
846
846
  //Instantiating a Workbook object
847
847
  var workbook = new Workbook();
848
- var cells = workbook.getWorksheets().get(0).getCells();
848
+ var cells = workbook.worksheets.get(0).cells;
849
849
  cells.get("A1").putValue("Hello World");
850
850
  var style = cells.get("A1").getStyle();
851
851
  //Set ThemeColorType.Text2 color type with 40% lighten as the font color.
852
- style.getFont().setThemeColor(new ThemeColor(ThemeColorType.Text2, 0.4));
853
- style.setPattern(BackgroundType.Solid);
852
+ style.font.themeColor = new ThemeColor(ThemeColorType.Text2, 0.4);
853
+ style.pattern = BackgroundType.Solid;
854
854
  //Set ThemeColorType.Background2 color type with 75% darken as the foreground color
855
- style.setForegroundThemeColor(new ThemeColor(ThemeColorType.Background2, -0.75));
855
+ style.foregroundThemeColor = new ThemeColor(ThemeColorType.Background2, -0.75);
856
856
  cells.get("A1").setStyle(style);
857
857
  //Saving the Excel file
858
858
  workbook.save("output/ThemeColor.xlsx");
@@ -865,48 +865,48 @@ function sampleDrawingTextBox() {
865
865
  //Instantiate a new Workbook.
866
866
  var workbook = new Workbook();
867
867
  //Get the first worksheet in the book.
868
- var worksheet = workbook.getWorksheets().get(0);
868
+ var worksheet = workbook.worksheets.get(0);
869
869
  //Add a new textbox to the collection.
870
- var textboxIndex = worksheet.getTextBoxes().add(2, 1, 160, 200);
870
+ var textboxIndex = worksheet.textBoxes.add(2, 1, 160, 200);
871
871
  //Get the textbox object.
872
- var textbox0 = worksheet.getTextBoxes().get(textboxIndex);
872
+ var textbox0 = worksheet.textBoxes.get(textboxIndex);
873
873
  //Fill the text.
874
- textbox0.setText("ASPOSE CELLS");
874
+ textbox0.text = "ASPOSE CELLS";
875
875
  //Set the textbox to adjust it according to its contents.
876
- textbox0.getTextBody().getTextAlignment().setAutoSize(true);
876
+ textbox0.textBody.textAlignment.autoSize = true;
877
877
  //Set the placement.
878
- textbox0.setPlacement(PlacementType.FreeFloating);
878
+ textbox0.placement = PlacementType.FreeFloating;
879
879
  //Set the font color.
880
- textbox0.getFont().setColor(Color.Blue);
880
+ textbox0.font.color = Color.Blue;
881
881
  //Set the font to bold.
882
- textbox0.getFont().setIsBold(true);
882
+ textbox0.font.isBold = true;
883
883
  //Set the font size.
884
- textbox0.getFont().setSize(14);
884
+ textbox0.font.size = 14;
885
885
  //Set font attribute to italic.
886
- textbox0.getFont().setIsItalic(true);
886
+ textbox0.font.isItalic = true;
887
887
  //Add a hyperlink to the textbox.
888
- textbox0.addHyperlink("http://www.aspose.com/");
888
+ textbox0.addHyperlink("https://www.aspose.com/");
889
889
  //Get the filformat of the textbox.
890
- var fillformat = textbox0.getFill();
890
+ var fillformat = textbox0.fill;
891
891
  //Set the fillcolor.
892
- fillformat.getSolidFill().setColor(Color.Silver);
892
+ fillformat.solidFill.color = Color.Silver;
893
893
  //Get the lineformat type of the textbox.
894
- var lineformat = textbox0.getLine();
894
+ var lineformat = textbox0.line;
895
895
  //Set the line style.
896
- lineformat.setCompoundType(MsoLineStyle.ThinThick);
896
+ lineformat.compoundType = MsoLineStyle.ThinThick;
897
897
  //Set the line weight.
898
- lineformat.setWeight(6);
898
+ lineformat.weight = 6;
899
899
  //Set the dash style to squaredot.
900
- lineformat.setDashStyle(MsoLineDashStyle.SquareDot);
900
+ lineformat.dashStyle = MsoLineDashStyle.SquareDot;
901
901
  //Add another textbox.
902
- textboxIndex = worksheet.getTextBoxes().add(15, 4, 85, 120);
902
+ textboxIndex = worksheet.textBoxes.add(15, 4, 85, 120);
903
903
  //Get the second textbox.
904
- var textbox1 = worksheet.getTextBoxes().get(textboxIndex);
904
+ var textbox1 = worksheet.textBoxes.get(textboxIndex);
905
905
  //Input some text to it.
906
- textbox1.setText("This is another simple text box");
906
+ textbox1.text = "This is another simple text box";
907
907
  //Set the placement type as the textbox will move and
908
908
  //resize with cells.
909
- textbox1.setPlacement(PlacementType.MoveAndSize);
909
+ textbox1.placement = PlacementType.MoveAndSize;
910
910
  //Save the excel file.
911
911
  workbook.save("output/DrawingTextBox.xlsx");
912
912
  }
@@ -917,15 +917,15 @@ function sampleTablesTableStyle() {
917
917
 
918
918
  var workbook = new Workbook();
919
919
  var firstColumnStyle = workbook.createStyle();
920
- firstColumnStyle.setPattern(BackgroundType.Solid);
921
- firstColumnStyle.setBackgroundColor(Color.Red);
920
+ firstColumnStyle.pattern = BackgroundType.Solid;
921
+ firstColumnStyle.backgroundColor = Color.Red;
922
922
 
923
923
  var lastColumnStyle = workbook.createStyle();
924
- lastColumnStyle.getFont().setIsBold(true);
925
- lastColumnStyle.setPattern(BackgroundType.Solid);
926
- lastColumnStyle.setBackgroundColor(Color.Red);
924
+ lastColumnStyle.font.isBold = true;
925
+ lastColumnStyle.pattern = BackgroundType.Solid;
926
+ lastColumnStyle.backgroundColor = Color.Red;
927
927
  var tableStyleName = "Custom1";
928
- var tableStyles = workbook.getWorksheets().getTableStyles();
928
+ var tableStyles = workbook.worksheets.getTableStyles();
929
929
  var index1 = tableStyles.addTableStyle(tableStyleName);
930
930
  var tableStyle = tableStyles.get(index1);
931
931
  var elements = tableStyle.getTableStyleElements();
@@ -935,7 +935,7 @@ function sampleTablesTableStyle() {
935
935
  index1 = elements.add(TableStyleElementType.LastColumn);
936
936
  element = elements.get(index1);
937
937
  element.setElementStyle(lastColumnStyle);
938
- var cells = workbook.getWorksheets().get(0).getCells();
938
+ var cells = workbook.worksheets.get(0).cells;
939
939
  for (var i = 0; i < 5; i++) {
940
940
  cells.get(0, i).putValue(CellsHelper.columnIndexToName(i));
941
941
  }
@@ -944,12 +944,12 @@ function sampleTablesTableStyle() {
944
944
  cells.get(row, column).putValue(row * column);
945
945
  }
946
946
  }
947
- var tables = workbook.getWorksheets().get(0).getListObjects();
947
+ var tables = workbook.worksheets.get(0).getListObjects();
948
948
  var index = tables.add(0, 0, 9, 4, true);
949
949
  var table = tables.get(0);
950
- table.setShowTableStyleFirstColumn(true);
951
- table.setShowTableStyleLastColumn(true);
952
- table.setTableStyleName(tableStyleName);
950
+ table.showTableStyleFirstColumn = true;
951
+ table.showTableStyleLastColumn = true;
952
+ table.tableStyleName = tableStyleName;
953
953
  workbook.save("output/TablesTableStyle.xlsx");
954
954
  }
955
955
  sampleTablesTableStyle();
@@ -968,11 +968,11 @@ function sampleHyperlink() {
968
968
  //Instantiating a Workbook object
969
969
  var workbook = new Workbook();
970
970
  //Adding a new worksheet to the Workbook object
971
- workbook.getWorksheets().add();
971
+ workbook.worksheets.add();
972
972
  //Obtaining the reference of the newly added worksheet by passing its sheet index
973
- var worksheet = workbook.getWorksheets().get(0);
973
+ var worksheet = workbook.worksheets.get(0);
974
974
  //Adding a hyperlink to a URL at "A1" cell
975
- worksheet.getHyperlinks().add("A1", 1, 1, "http://www.aspose.com");
975
+ worksheet.hyperlinks.add("A1", 1, 1, "https://www.aspose.com");
976
976
  //Saving the Excel file
977
977
  workbook.save("output/Hyperlink.xls");
978
978
  }
@@ -984,46 +984,46 @@ function sampleChartsDisplayUnitLabel() {
984
984
  //Instantiating a Workbook object
985
985
  var workbook = new Workbook();
986
986
  //Adding a new worksheet to the Excel object
987
- var sheetIndex = workbook.getWorksheets().add();
987
+ var sheetIndex = workbook.worksheets.add();
988
988
  //Obtaining the reference of the newly added worksheet by passing its sheet index
989
- var worksheet = workbook.getWorksheets().get(sheetIndex);
989
+ var worksheet = workbook.worksheets.get(sheetIndex);
990
990
  //Adding a sample value to "A1" cell
991
- worksheet.getCells().get("A1").putValue(50);
991
+ worksheet.cells.get("A1").putValue(50);
992
992
  //Adding a sample value to "A2" cell
993
- worksheet.getCells().get("A2").putValue(100);
993
+ worksheet.cells.get("A2").putValue(100);
994
994
  //Adding a sample value to "A3" cell
995
- worksheet.getCells().get("A3").putValue(150);
995
+ worksheet.cells.get("A3").putValue(150);
996
996
  //Adding a sample value to "A4" cell
997
- worksheet.getCells().get("A4").putValue(200);
997
+ worksheet.cells.get("A4").putValue(200);
998
998
  //Adding a sample value to "B1" cell
999
- worksheet.getCells().get("B1").putValue(60);
999
+ worksheet.cells.get("B1").putValue(60);
1000
1000
  //Adding a sample value to "B2" cell
1001
- worksheet.getCells().get("B2").putValue(32);
1001
+ worksheet.cells.get("B2").putValue(32);
1002
1002
  //Adding a sample value to "B3" cell
1003
- worksheet.getCells().get("B3").putValue(50);
1003
+ worksheet.cells.get("B3").putValue(50);
1004
1004
  //Adding a sample value to "B4" cell
1005
- worksheet.getCells().get("B4").putValue(40);
1005
+ worksheet.cells.get("B4").putValue(40);
1006
1006
  //Adding a sample value to "C1" cell as category data
1007
- worksheet.getCells().get("C1").putValue("Q1");
1007
+ worksheet.cells.get("C1").putValue("Q1");
1008
1008
  //Adding a sample value to "C2" cell as category data
1009
- worksheet.getCells().get("C2").putValue("Q2");
1009
+ worksheet.cells.get("C2").putValue("Q2");
1010
1010
  //Adding a sample value to "C3" cell as category data
1011
- worksheet.getCells().get("C3").putValue("Y1");
1011
+ worksheet.cells.get("C3").putValue("Y1");
1012
1012
  //Adding a sample value to "C4" cell as category data
1013
- worksheet.getCells().get("C4").putValue("Y2");
1013
+ worksheet.cells.get("C4").putValue("Y2");
1014
1014
  //Adding a chart to the worksheet
1015
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
1015
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
1016
1016
  //Accessing the instance of the newly added chart
1017
- var chart = worksheet.getCharts().get(chartIndex);
1017
+ var chart = worksheet.charts.get(chartIndex);
1018
1018
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
1019
- chart.getNSeries().add("A1:B4", true);
1019
+ chart.nSeries.add("A1:B4", true);
1020
1020
  //Setting the data source for the category data of NSeries
1021
- chart.getNSeries().setCategoryData("C1:C4");
1021
+ chart.nSeries.categoryData = "C1:C4";
1022
1022
  //Setting the display unit of value(Y) axis.
1023
- chart.getValueAxis().setDisplayUnit(DisplayUnitType.Hundreds);
1024
- var displayUnitLabel = chart.getValueAxis().getDisplayUnitLabel();
1023
+ chart.valueAxis.sisplayUnit = DisplayUnitType.Hundreds;
1024
+ var displayUnitLabel = chart.valueAxis.displayUnitLabel;
1025
1025
  //Setting the custom display unit label
1026
- displayUnitLabel.setText("100");
1026
+ displayUnitLabel.text = "100";
1027
1027
  //Saving the Excel file
1028
1028
  workbook.save("output/ChartsDisplayUnitLabel.xls");
1029
1029
  }
@@ -1034,7 +1034,7 @@ function sampleWorkbookSettingShowTabs() {
1034
1034
 
1035
1035
  var workbook = new Workbook();
1036
1036
  // Hide the spreadsheet tabs.
1037
- workbook.getSettings().setShowTabs(false);
1037
+ workbook.settings.showTabs = false;
1038
1038
  }
1039
1039
  sampleWorkbookSettingShowTabs();
1040
1040
 
@@ -1043,7 +1043,7 @@ function sampleWorkbookSettingIsHScrollBarVisible() {
1043
1043
 
1044
1044
  var workbook = new Workbook();
1045
1045
  // Hide the horizontal scroll bar of the Excel file.
1046
- workbook.getSettings().setIsHScrollBarVisible(false);
1046
+ workbook.settings.isHScrollBarVisible = false;
1047
1047
  }
1048
1048
  sampleWorkbookSettingIsHScrollBarVisible();
1049
1049
 
@@ -1052,7 +1052,7 @@ function sampleWorkbookSettingIsVScrollBarVisible() {
1052
1052
 
1053
1053
  var workbook = new Workbook();
1054
1054
  // Hide the vertical scroll bar of the Excel file.
1055
- workbook.getSettings().setIsVScrollBarVisible(false);
1055
+ workbook.settings.isVScrollBarVisible = false;
1056
1056
  }
1057
1057
  sampleWorkbookSettingIsVScrollBarVisible();
1058
1058
 
@@ -1060,12 +1060,12 @@ function sampleProtection() {
1060
1060
  const { Workbook } = require("aspose.cells.node");
1061
1061
 
1062
1062
  var workbook = new Workbook();
1063
- var sheetIndex = workbook.getWorksheets().add();
1064
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1063
+ var sheetIndex = workbook.worksheets.add();
1064
+ var worksheet = workbook.worksheets.get(sheetIndex);
1065
1065
  //Allowing users to select locked cells of the worksheet
1066
- worksheet.getProtection().setAllowSelectingLockedCell(true);
1066
+ worksheet.protection.allowSelectingLockedCell = true;
1067
1067
  //Allowing users to select unlocked cells of the worksheet
1068
- worksheet.getProtection().setAllowSelectingUnlockedCell(true);
1068
+ worksheet.protection.allowSelectingUnlockedCell = true;
1069
1069
  }
1070
1070
  sampleProtection();
1071
1071
 
@@ -1075,14 +1075,14 @@ function sampleDrawingListBox() {
1075
1075
  //Create a new Workbook.
1076
1076
  var workbook = new Workbook();
1077
1077
  //Get the first worksheet.
1078
- var sheet = workbook.getWorksheets().get(0);
1078
+ var sheet = workbook.worksheets.get(0);
1079
1079
  //Get the worksheet cells collection.
1080
- var cells = sheet.getCells();
1080
+ var cells = sheet.cells;
1081
1081
 
1082
1082
  //Input a value.
1083
1083
  cells.get("B3").putValue("Choose Dept:");
1084
1084
  //Set it bold.
1085
- cells.get("B3").getStyle().getFont().setIsBold(true);
1085
+ cells.get("B3").getStyle().font.isBold = true;
1086
1086
  //Input some values that denote the input range
1087
1087
  //for the list box.
1088
1088
  cells.get("A2").putValue("Sales");
@@ -1093,17 +1093,17 @@ function sampleDrawingListBox() {
1093
1093
  cells.get("A7").putValue("HRA");
1094
1094
 
1095
1095
  //Add a new list box.
1096
- var listBox = sheet.getShapes().addListBox(2, 0, 3, 0, 122, 100);
1096
+ var listBox = sheet.shapes.addListBox(2, 0, 3, 0, 122, 100);
1097
1097
  //Set the placement type.
1098
- listBox.setPlacement(PlacementType.FreeFloating);
1098
+ listBox.placement = PlacementType.FreeFloating;
1099
1099
  //Set the linked cell.
1100
- listBox.setLinkedCell("A1");
1100
+ listBox.linkedCell = "A1";
1101
1101
  //Set the input range.
1102
- listBox.setInputRange("A2:A7");
1102
+ listBox.inputRange = "A2:A7";
1103
1103
  //Set the selection tyle.
1104
- listBox.setSelectionType(SelectionType.Single);
1104
+ listBox.selectionType = SelectionType.Single;
1105
1105
  //Set the list box with 3-D shading.
1106
- listBox.setShadow(true);
1106
+ listBox.shadow = true;
1107
1107
 
1108
1108
  //Saves the file.
1109
1109
  workbook.save("output/DrawingListBox.xls");
@@ -1115,9 +1115,9 @@ function sampleChartsLegend() {
1115
1115
 
1116
1116
  //Set Legend's width and height
1117
1117
  var workbook = new Workbook();
1118
- var sheetIndex = workbook.getWorksheets().add();
1119
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1120
- var charts = worksheet.getCharts();
1118
+ var sheetIndex = workbook.worksheets.add();
1119
+ var worksheet = workbook.worksheets.get(sheetIndex);
1120
+ var charts = worksheet.charts;
1121
1121
  //Create a chart
1122
1122
  var chart = charts.get(charts.add(ChartType.Column, 1, 1, 10, 10));
1123
1123
  var legend = chart.getLegend();
@@ -1125,11 +1125,11 @@ function sampleChartsLegend() {
1125
1125
  //Legend is at right side of chart by default.
1126
1126
  //If the legend is at left or right side of the chart, setting Legend.X property will not take effect.
1127
1127
  //If the legend is at top or bottom side of the chart, setting Legend.Y property will not take effect.
1128
- legend.setY(1500);
1129
- legend.setWidth(50);
1130
- legend.setHeight(50);
1128
+ legend.y = 1500;
1129
+ legend.width = 50;
1130
+ legend.height = 50;
1131
1131
  //Set legend's position
1132
- legend.setPosition(LegendPositionType.Left);
1132
+ legend.position = LegendPositionType.Left;
1133
1133
  }
1134
1134
  sampleChartsLegend();
1135
1135
 
@@ -1139,36 +1139,36 @@ function sampleChartsChartPoint() {
1139
1139
  //Instantiating a Workbook object
1140
1140
  var workbook = new Workbook();
1141
1141
  //Obtaining the reference of the first worksheet
1142
- var worksheet = workbook.getWorksheets().get(0);
1142
+ var worksheet = workbook.worksheets.get(0);
1143
1143
 
1144
1144
  //Adding a sample value to "A1" cell
1145
- worksheet.getCells().get("A1").putValue(50);
1145
+ worksheet.cells.get("A1").putValue(50);
1146
1146
  //Adding a sample value to "A2" cell
1147
- worksheet.getCells().get("A2").putValue(100);
1147
+ worksheet.cells.get("A2").putValue(100);
1148
1148
  //Adding a sample value to "A3" cell
1149
- worksheet.getCells().get("A3").putValue(150);
1149
+ worksheet.cells.get("A3").putValue(150);
1150
1150
  //Adding a sample value to "B1" cell
1151
- worksheet.getCells().get("B1").putValue(60);
1151
+ worksheet.cells.get("B1").putValue(60);
1152
1152
  //Adding a sample value to "B2" cell
1153
- worksheet.getCells().get("B2").putValue(32);
1153
+ worksheet.cells.get("B2").putValue(32);
1154
1154
  //Adding a sample value to "B3" cell
1155
- worksheet.getCells().get("B3").putValue(50);
1155
+ worksheet.cells.get("B3").putValue(50);
1156
1156
 
1157
1157
  //Adding a chart to the worksheet
1158
- var chartIndex = worksheet.getCharts().add(ChartType.PieExploded, 5, 0, 25, 10);
1158
+ var chartIndex = worksheet.charts.add(ChartType.PieExploded, 5, 0, 25, 10);
1159
1159
  //Accessing the instance of the newly added chart
1160
- var chart = worksheet.getCharts().get(chartIndex);
1160
+ var chart = worksheet.charts.get(chartIndex);
1161
1161
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
1162
- chart.getNSeries().add("A1:B3", true);
1162
+ chart.nSeries.add("A1:B3", true);
1163
1163
  //Show Data Labels
1164
- chart.getNSeries().get(0).getDataLabels().setShowValue(true);
1165
- for (var i = 0; i < chart.getNSeries().get(0).getPoints().getCount(); i++) {
1164
+ chart.nSeries.get(0).dataLabels.showValue = true;
1165
+ for (var i = 0; i < chart.nSeries.get(0).points.count; i++) {
1166
1166
  //Get Data Point
1167
- var point = chart.getNSeries().get(0).getPoints().get(i);
1167
+ var point = chart.nSeries.get(0).points.get(i);
1168
1168
  //Set Pir Explosion
1169
- point.setExplosion(15);
1169
+ point.explosion = 15;
1170
1170
  //Set Border Color
1171
- point.getBorder().setColor(Color.Red);
1171
+ point.border.color = Color.Red;
1172
1172
  }
1173
1173
 
1174
1174
  //Saving the Excel file
@@ -1182,34 +1182,34 @@ function sampleDrawingArcShape() {
1182
1182
  //Instantiate a new Workbook.
1183
1183
  var excelbook = new Workbook();
1184
1184
  //Add an arc shape.
1185
- var arc1 = excelbook.getWorksheets().get(0).getShapes().addArc(2, 0, 2, 0, 130, 130);
1185
+ var arc1 = excelbook.worksheets.get(0).shapes.addArc(2, 0, 2, 0, 130, 130);
1186
1186
  //Set the placement of the arc.
1187
- arc1.setPlacement(PlacementType.FreeFloating);
1187
+ arc1.placement = PlacementType.FreeFloating;
1188
1188
  //Set the fill format.
1189
- arc1.getFill().setFillType(FillType.Solid)
1190
- arc1.getFill().getSolidFill().setColor(Color.Blue);
1189
+ arc1.fill.fillType = FillType.Solid;
1190
+ arc1.fill.solidFill.color = Color.Blue;
1191
1191
  //Set the line style.
1192
- arc1.getLine().setCompoundType(MsoLineStyle.Single);
1192
+ arc1.line.compoundType = MsoLineStyle.Single;
1193
1193
  //Set the line weight.
1194
- arc1.getLine().setWeight(2);
1194
+ arc1.line.weight = 2;
1195
1195
  //Set the color of the arc line.
1196
- arc1.getLine().setFillType(FillType.Solid)
1197
- arc1.getLine().getSolidFill().setColor(Color.Red);
1196
+ arc1.line.fillType = FillType.Solid;
1197
+ arc1.line.solidFill.color = Color.Red;
1198
1198
  //Set the dash style of the arc.
1199
- arc1.getLine().setDashStyle(MsoLineDashStyle.Solid);
1199
+ arc1.line.dashStyle = MsoLineDashStyle.Solid;
1200
1200
  //Add another arc shape.
1201
- var arc2 = excelbook.getWorksheets().get(0).getShapes().addArc(9, 0, 2, 0, 130, 130);
1201
+ var arc2 = excelbook.worksheets.get(0).shapes.addArc(9, 0, 2, 0, 130, 130);
1202
1202
  //Set the placement of the arc.
1203
- arc2.setPlacement(PlacementType.FreeFloating);
1203
+ arc2.placement = PlacementType.FreeFloating;
1204
1204
  //Set the line style.
1205
- arc2.getLine().setCompoundType(MsoLineStyle.Single);
1205
+ arc2.line.compoundType = MsoLineStyle.Single;
1206
1206
  //Set the line weight.
1207
- arc2.getLine().setWeight(1);
1207
+ arc2.line.weight = 1;
1208
1208
  //Set the color of the arc line.
1209
- arc2.getLine().setFillType(FillType.Solid);
1210
- arc2.getLine().getSolidFill().setColor(Color.Blue);
1209
+ arc2.line.fillType = FillType.Solid;
1210
+ arc2.line.solidFill.color = Color.Blue;
1211
1211
  //Set the dash style of the arc.
1212
- arc2.getLine().setDashStyle(MsoLineDashStyle.Solid);
1212
+ arc2.line.dashStyle = MsoLineDashStyle.Solid;
1213
1213
  //Save the excel file.
1214
1214
  excelbook.save("output/DrawingArcShape.xls");
1215
1215
  }
@@ -1220,9 +1220,9 @@ function sampleFormatConditionCollection() {
1220
1220
 
1221
1221
  //Adds an empty conditional formatting
1222
1222
  var workbook = new Workbook();
1223
- var sheet = workbook.getWorksheets().get(0);
1224
- var index = sheet.getConditionalFormattings().add();
1225
- var fcs = sheet.getConditionalFormattings().get(index);
1223
+ var sheet = workbook.worksheets.get(0);
1224
+ var index = sheet.conditionalFormattings.add();
1225
+ var fcs = sheet.conditionalFormattings.get(index);
1226
1226
  //Sets the conditional format range.
1227
1227
  var ca = new CellArea();
1228
1228
  ca.startRow = 0;
@@ -1242,7 +1242,7 @@ function sampleFormatConditionCollection() {
1242
1242
  var conditionIndex2 = fcs.addCondition(FormatConditionType.CellValue, OperatorType.Between, "50", "100");
1243
1243
  //Sets the background color.
1244
1244
  var fc = fcs.get(conditionIndex);
1245
- fc.getStyle().setBackgroundColor(Color.Red);
1245
+ fc.style.backgroundColor = Color.Red;
1246
1246
  //Saving the Excel file
1247
1247
  workbook.save("output/FormatConditionCollection.xls");
1248
1248
  }
@@ -1252,7 +1252,7 @@ function sampleCommentCollection() {
1252
1252
  const { Workbook } = require("aspose.cells.node");
1253
1253
 
1254
1254
  var workbook = new Workbook();
1255
- var comments = workbook.getWorksheets().get(0).getComments();
1255
+ var comments = workbook.worksheets.get(0).comments;
1256
1256
  }
1257
1257
  sampleCommentCollection();
1258
1258
 
@@ -1262,29 +1262,29 @@ function sampleBorderCollection() {
1262
1262
  //Instantiating a Workbook object
1263
1263
  var workbook = new Workbook();
1264
1264
  //Obtaining the reference of the newly added worksheet by passing its sheet index
1265
- var worksheet = workbook.getWorksheets().get(0);
1265
+ var worksheet = workbook.worksheets.get(0);
1266
1266
  //Accessing the "A1" cell from the worksheet
1267
- var cell = worksheet.getCells().get("A1");
1267
+ var cell = worksheet.cells.get("A1");
1268
1268
  //Adding some value to the "A1" cell
1269
1269
  cell.putValue("Visit Aspose!");
1270
1270
  //Get style object from cell
1271
1271
  var style = cell.getStyle();
1272
1272
  //Setting the line style of the top border
1273
- style.getBorders().get(BorderType.TopBorder).setLineStyle(CellBorderType.Thick);
1273
+ style.borders.get(BorderType.TopBorder).lineStyle = CellBorderType.Thick;
1274
1274
  //Setting the color of the top border
1275
- style.getBorders().get(BorderType.TopBorder).setColor(Color.Black);
1275
+ style.borders.get(BorderType.TopBorder).color = Color.Black;
1276
1276
  //Setting the line style of the bottom border
1277
- style.getBorders().get(BorderType.BottomBorder).setLineStyle(CellBorderType.Thick);
1277
+ style.borders.get(BorderType.BottomBorder).lineStyle = CellBorderType.Thick;
1278
1278
  //Setting the color of the bottom border
1279
- style.getBorders().get(BorderType.BottomBorder).setColor(Color.Black);
1279
+ style.borders.get(BorderType.BottomBorder).color = Color.Black;
1280
1280
  //Setting the line style of the left border
1281
- style.getBorders().get(BorderType.LeftBorder).setLineStyle(CellBorderType.Thick);
1281
+ style.borders.get(BorderType.LeftBorder).lineStyle = CellBorderType.Thick;
1282
1282
  //Setting the color of the left border
1283
- style.getBorders().get(BorderType.LeftBorder).setColor(Color.Black);
1283
+ style.borders.get(BorderType.LeftBorder).color = Color.Black;
1284
1284
  //Setting the line style of the right border
1285
- style.getBorders().get(BorderType.RightBorder).setLineStyle(CellBorderType.Thick);
1285
+ style.borders.get(BorderType.RightBorder).lineStyle = CellBorderType.Thick;
1286
1286
  //Setting the color of the right border
1287
- style.getBorders().get(BorderType.RightBorder).setColor(Color.Black);
1287
+ style.borders.get(BorderType.RightBorder).color = Color.Black;
1288
1288
  //Set style object to cell
1289
1289
  cell.setStyle(style);
1290
1290
 
@@ -1299,37 +1299,37 @@ function sampleChartsAxis() {
1299
1299
  //Instantiating a Workbook object
1300
1300
  var workbook = new Workbook();
1301
1301
  //Adding a new worksheet to the Excel object
1302
- var sheetIndex = workbook.getWorksheets().add();
1302
+ var sheetIndex = workbook.worksheets.add();
1303
1303
  //Obtaining the reference of the newly added worksheet by passing its sheet index
1304
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1304
+ var worksheet = workbook.worksheets.get(sheetIndex);
1305
1305
  //Adding a sample value to "A1" cell
1306
- worksheet.getCells().get("A1").putValue(50);
1306
+ worksheet.cells.get("A1").putValue(50);
1307
1307
  //Adding a sample value to "A2" cell
1308
- worksheet.getCells().get("A2").putValue(100);
1308
+ worksheet.cells.get("A2").putValue(100);
1309
1309
  //Adding a sample value to "A3" cell
1310
- worksheet.getCells().get("A3").putValue(150);
1310
+ worksheet.cells.get("A3").putValue(150);
1311
1311
  //Adding a sample value to "B1" cell
1312
- worksheet.getCells().get("B1").putValue(4);
1312
+ worksheet.cells.get("B1").putValue(4);
1313
1313
  //Adding a sample value to "B2" cell
1314
- worksheet.getCells().get("B2").putValue(20);
1314
+ worksheet.cells.get("B2").putValue(20);
1315
1315
  //Adding a sample value to "B3" cell
1316
- worksheet.getCells().get("B3").putValue(50);
1316
+ worksheet.cells.get("B3").putValue(50);
1317
1317
  //Adding a chart to the worksheet
1318
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 5);
1318
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 5);
1319
1319
  //Accessing the instance of the newly added chart
1320
- var chart = worksheet.getCharts().get(chartIndex);
1320
+ var chart = worksheet.charts.get(chartIndex);
1321
1321
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
1322
- chart.getNSeries().add("A1:B3", true);
1322
+ chart.nSeries.add("A1:B3", true);
1323
1323
  //Set the max value of value axis
1324
- chart.getValueAxis().setMaxValue(200);
1324
+ chart.valueAxis.maxValue = 200;
1325
1325
  //Set the min value of value axis
1326
- chart.getValueAxis().setMinValue(0);
1326
+ chart.valueAxis.minValue = 0;
1327
1327
  //Set the major unit
1328
- chart.getValueAxis().setMajorUnit(25);
1328
+ chart.valueAxis.majorUnit = 25;
1329
1329
  //Category(X) axis crosses at the maxinum value.
1330
- chart.getValueAxis().setCrossType(CrossType.Maximum);
1330
+ chart.valueAxis.crossType = CrossType.Maximum;
1331
1331
  //Set he number of categories or series between tick-mark labels.
1332
- chart.getCategoryAxis().setTickLabelSpacing(2);
1332
+ chart.categoryAxis.tickLabelSpacing = 2;
1333
1333
  //Saving the Excel file
1334
1334
  workbook.save("output/ChartsAxis.xlsx");
1335
1335
  }
@@ -1340,29 +1340,29 @@ function sampleChartsAxisMajorUnitScale() {
1340
1340
 
1341
1341
  var workbook = new Workbook();
1342
1342
  //Adding a new worksheet to the Excel object
1343
- var sheetIndex = workbook.getWorksheets().add();
1343
+ var sheetIndex = workbook.worksheets.add();
1344
1344
  //Obtaining the reference of the newly added worksheet by passing its sheet index
1345
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1345
+ var worksheet = workbook.worksheets.get(sheetIndex);
1346
1346
  //Adding a sample value to "A1" cell
1347
- worksheet.getCells().get("A1").putValue(50);
1347
+ worksheet.cells.get("A1").putValue(50);
1348
1348
  //Adding a sample value to "A2" cell
1349
- worksheet.getCells().get("A2").putValue(100);
1349
+ worksheet.cells.get("A2").putValue(100);
1350
1350
  //Adding a sample value to "A3" cell
1351
- worksheet.getCells().get("A3").putValue(150);
1351
+ worksheet.cells.get("A3").putValue(150);
1352
1352
  //Adding a sample value to "B1" cell
1353
- worksheet.getCells().get("B1").putValue(4);
1353
+ worksheet.cells.get("B1").putValue(4);
1354
1354
  //Adding a sample value to "B2" cell
1355
- worksheet.getCells().get("B2").putValue(20);
1355
+ worksheet.cells.get("B2").putValue(20);
1356
1356
  //Adding a sample value to "B3" cell
1357
- worksheet.getCells().get("B3").putValue(50);
1357
+ worksheet.cells.get("B3").putValue(50);
1358
1358
 
1359
1359
  //Adding a chart to the worksheet
1360
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 5);
1360
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 5);
1361
1361
  //Accessing the instance of the newly added chart
1362
- var chart = worksheet.getCharts().get(chartIndex);
1363
- chart.getCategoryAxis().setCategoryType(CategoryType.TimeScale);
1364
- chart.getCategoryAxis().setMajorUnitScale(TimeUnit.Months);
1365
- chart.getCategoryAxis().setMajorUnit(2);
1362
+ var chart = worksheet.charts.get(chartIndex);
1363
+ chart.categoryAxis.categoryType = CategoryType.TimeScale;
1364
+ chart.categoryAxis.majorUnitScale = TimeUnit.Months;
1365
+ chart.categoryAxis.majorUnit = 2;
1366
1366
  }
1367
1367
  sampleChartsAxisMajorUnitScale();
1368
1368
 
@@ -1371,29 +1371,29 @@ function sampleChartsAxisMinorUnitScale() {
1371
1371
 
1372
1372
  var workbook = new Workbook();
1373
1373
  //Adding a new worksheet to the Excel object
1374
- var sheetIndex = workbook.getWorksheets().add();
1374
+ var sheetIndex = workbook.worksheets.add();
1375
1375
  //Obtaining the reference of the newly added worksheet by passing its sheet index
1376
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1376
+ var worksheet = workbook.worksheets.get(sheetIndex);
1377
1377
  //Adding a sample value to "A1" cell
1378
- worksheet.getCells().get("A1").putValue(50);
1378
+ worksheet.cells.get("A1").putValue(50);
1379
1379
  //Adding a sample value to "A2" cell
1380
- worksheet.getCells().get("A2").putValue(100);
1380
+ worksheet.cells.get("A2").putValue(100);
1381
1381
  //Adding a sample value to "A3" cell
1382
- worksheet.getCells().get("A3").putValue(150);
1382
+ worksheet.cells.get("A3").putValue(150);
1383
1383
  //Adding a sample value to "B1" cell
1384
- worksheet.getCells().get("B1").putValue(4);
1384
+ worksheet.cells.get("B1").putValue(4);
1385
1385
  //Adding a sample value to "B2" cell
1386
- worksheet.getCells().get("B2").putValue(20);
1386
+ worksheet.cells.get("B2").putValue(20);
1387
1387
  //Adding a sample value to "B3" cell
1388
- worksheet.getCells().get("B3").putValue(50);
1388
+ worksheet.cells.get("B3").putValue(50);
1389
1389
 
1390
1390
  //Adding a chart to the worksheet
1391
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 5);
1391
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 5);
1392
1392
  //Accessing the instance of the newly added chart
1393
- var chart = worksheet.getCharts().get(chartIndex);
1394
- chart.getCategoryAxis().setCategoryType(CategoryType.TimeScale);
1395
- chart.getCategoryAxis().setMinorUnitScale(TimeUnit.Months);
1396
- chart.getCategoryAxis().setMinorUnit(2);
1393
+ var chart = worksheet.charts.get(chartIndex);
1394
+ chart.categoryAxis.categoryType = CategoryType.TimeScale;
1395
+ chart.categoryAxis.minorUnitScale = TimeUnit.Months;
1396
+ chart.categoryAxis.minorUnit = 2;
1397
1397
  }
1398
1398
  sampleChartsAxisMinorUnitScale();
1399
1399
 
@@ -1402,28 +1402,28 @@ function sampleChartsAxisMajorGridLines() {
1402
1402
 
1403
1403
  var workbook = new Workbook();
1404
1404
  //Adding a new worksheet to the Excel object
1405
- var sheetIndex = workbook.getWorksheets().add();
1405
+ var sheetIndex = workbook.worksheets.add();
1406
1406
  //Obtaining the reference of the newly added worksheet by passing its sheet index
1407
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1407
+ var worksheet = workbook.worksheets.get(sheetIndex);
1408
1408
  //Adding a sample value to "A1" cell
1409
- worksheet.getCells().get("A1").putValue(50);
1409
+ worksheet.cells.get("A1").putValue(50);
1410
1410
  //Adding a sample value to "A2" cell
1411
- worksheet.getCells().get("A2").putValue(100);
1411
+ worksheet.cells.get("A2").putValue(100);
1412
1412
  //Adding a sample value to "A3" cell
1413
- worksheet.getCells().get("A3").putValue(150);
1413
+ worksheet.cells.get("A3").putValue(150);
1414
1414
  //Adding a sample value to "B1" cell
1415
- worksheet.getCells().get("B1").putValue(4);
1415
+ worksheet.cells.get("B1").putValue(4);
1416
1416
  //Adding a sample value to "B2" cell
1417
- worksheet.getCells().get("B2").putValue(20);
1417
+ worksheet.cells.get("B2").putValue(20);
1418
1418
  //Adding a sample value to "B3" cell
1419
- worksheet.getCells().get("B3").putValue(50);
1419
+ worksheet.cells.get("B3").putValue(50);
1420
1420
 
1421
1421
  //Adding a chart to the worksheet
1422
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 5);
1422
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 5);
1423
1423
  //Accessing the instance of the newly added chart
1424
- var chart = worksheet.getCharts().get(chartIndex);
1425
- chart.getValueAxis().getMajorGridLines().setIsVisible(false);
1426
- chart.getCategoryAxis().getMajorGridLines().setIsVisible(true);
1424
+ var chart = worksheet.charts.get(chartIndex);
1425
+ chart.valueAxis.majorGridLines.isVisible = false;
1426
+ chart.categoryAxis.majorGridLines.isVisible = true;
1427
1427
  }
1428
1428
  sampleChartsAxisMajorGridLines();
1429
1429
 
@@ -1470,11 +1470,11 @@ function sampleFormatCondition() {
1470
1470
 
1471
1471
  //Instantiating a Workbook object
1472
1472
  var workbook = new Workbook();
1473
- var sheet = workbook.getWorksheets().get(0);
1473
+ var sheet = workbook.worksheets.get(0);
1474
1474
 
1475
1475
  //Adds an empty conditional formatting
1476
- var index = sheet.getConditionalFormattings().add();
1477
- var fcs = sheet.getConditionalFormattings().get(index);
1476
+ var index = sheet.conditionalFormattings.add();
1477
+ var fcs = sheet.conditionalFormattings.get(index);
1478
1478
 
1479
1479
  //Sets the conditional format range.
1480
1480
  var ca = new CellArea();
@@ -1498,7 +1498,7 @@ function sampleFormatCondition() {
1498
1498
 
1499
1499
  //Sets the background color.
1500
1500
  var fc = fcs.get(conditionIndex);
1501
- fc.getStyle().setBackgroundColor(Color.Red);
1501
+ fc.style.backgroundColor = Color.Red;
1502
1502
 
1503
1503
  //Saving the Excel file
1504
1504
  workbook.save("output/FormatCondition.xls");
@@ -1510,36 +1510,36 @@ function sampleChartsDataLabels() {
1510
1510
 
1511
1511
  var workbook = new Workbook();
1512
1512
  //Adding a new worksheet to the Excel object
1513
- var sheetIndex = workbook.getWorksheets().add();
1513
+ var sheetIndex = workbook.worksheets.add();
1514
1514
  //Obtaining the reference of the newly added worksheet by passing its sheet index
1515
- var worksheet = workbook.getWorksheets().get(sheetIndex);
1515
+ var worksheet = workbook.worksheets.get(sheetIndex);
1516
1516
  //Adding a sample value to "A1" cell
1517
- worksheet.getCells().get("A1").putValue(50);
1517
+ worksheet.cells.get("A1").putValue(50);
1518
1518
  //Adding a sample value to "A2" cell
1519
- worksheet.getCells().get("A2").putValue(100);
1519
+ worksheet.cells.get("A2").putValue(100);
1520
1520
  //Adding a sample value to "A3" cell
1521
- worksheet.getCells().get("A3").putValue(150);
1521
+ worksheet.cells.get("A3").putValue(150);
1522
1522
  //Adding a sample value to "B1" cell
1523
- worksheet.getCells().get("B1").putValue(4);
1523
+ worksheet.cells.get("B1").putValue(4);
1524
1524
  //Adding a sample value to "B2" cell
1525
- worksheet.getCells().get("B2").putValue(20);
1525
+ worksheet.cells.get("B2").putValue(20);
1526
1526
  //Adding a sample value to "B3" cell
1527
- worksheet.getCells().get("B3").putValue(50);
1527
+ worksheet.cells.get("B3").putValue(50);
1528
1528
 
1529
1529
  //Adding a chart to the worksheet
1530
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 5);
1530
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 5);
1531
1531
  //Accessing the instance of the newly added chart
1532
- var chart = worksheet.getCharts().get(chartIndex);
1532
+ var chart = worksheet.charts.get(chartIndex);
1533
1533
  //Set the DataLabels in the chart
1534
1534
  var datalabels;
1535
- for (var i = 0; i < chart.getNSeries().getCount(); i++) {
1536
- datalabels = chart.getNSeries().get(i).getDataLabels();
1535
+ for (var i = 0; i < chart.nSeries.count; i++) {
1536
+ datalabels = chart.nSeries.get(i).dataLabels;
1537
1537
  //Set the position of DataLabels
1538
- datalabels.setPosition(LabelPositionType.InsideBase);
1538
+ datalabels.position = LabelPositionType.InsideBase;
1539
1539
  //Show the category name in the DataLabels
1540
1540
  datalabels.setCategoryNameShown(true);
1541
1541
  //Show the value in the DataLabels
1542
- datalabels.setShowValue(true);
1542
+ datalabels.showValue = true;
1543
1543
  //Not show the percentage in the DataLabels
1544
1544
  datalabels.setPercentageShown(false);
1545
1545
  //Not show the legend key.
@@ -1552,11 +1552,11 @@ function sampleWorksheet() {
1552
1552
  const { Workbook } = require("aspose.cells.node");
1553
1553
 
1554
1554
  var workbook = new Workbook();
1555
- var sheet = workbook.getWorksheets().get(0);
1555
+ var sheet = workbook.worksheets.get(0);
1556
1556
  //Freeze panes at "AS40" with 10 rows and 10 columns
1557
1557
  sheet.freezePanes("AS40", 10, 10);
1558
1558
  //Add a hyperlink in Cell A1
1559
- sheet.getHyperlinks().add("A1", 1, 1, "http://www.aspose.com");
1559
+ sheet.hyperlinks.add("A1", 1, 1, "https://www.aspose.com");
1560
1560
  }
1561
1561
  sampleWorksheet();
1562
1562
 
@@ -1566,7 +1566,7 @@ function sampleWorksheetProtectTypeStringString() {
1566
1566
  //Instantiating a Workbook object
1567
1567
  var excel = new Workbook("input/Book1.xls");
1568
1568
  //Accessing the first worksheet in the Excel file
1569
- var worksheet = excel.getWorksheets().get(0);
1569
+ var worksheet = excel.worksheets.get(0);
1570
1570
  //Protecting the worksheet with a password
1571
1571
  worksheet.protect(ProtectionType.All, "aspose", null);
1572
1572
  //Saving the modified Excel file in default (that is Excel 20003) format
@@ -1579,8 +1579,8 @@ function sampleHorizontalPageBreakCollection() {
1579
1579
 
1580
1580
  var excel = new Workbook();
1581
1581
  //Add a pagebreak at G5
1582
- excel.getWorksheets().get(0).getHorizontalPageBreaks().add("G5");
1583
- excel.getWorksheets().get(0).getVerticalPageBreaks().add("G5");
1582
+ excel.worksheets.get(0).horizontalPageBreaks.add("G5");
1583
+ excel.worksheets.get(0).verticalPageBreaks.add("G5");
1584
1584
  }
1585
1585
  sampleHorizontalPageBreakCollection();
1586
1586
 
@@ -1588,9 +1588,9 @@ function sampleDrawingCheckbox() {
1588
1588
  const { Workbook } = require("aspose.cells.node");
1589
1589
 
1590
1590
  var excel = new Workbook();
1591
- var index = excel.getWorksheets().get(0).getCheckBoxes().add(15, 15, 20, 100);
1592
- var checkBox = excel.getWorksheets().get(0).getCheckBoxes().get(index);
1593
- checkBox.setText("Check Box 1");
1591
+ var index = excel.worksheets.get(0).checkBoxes.add(15, 15, 20, 100);
1592
+ var checkBox = excel.worksheets.get(0).checkBoxes.get(index);
1593
+ checkBox.text = "Check Box 1";
1594
1594
  }
1595
1595
  sampleDrawingCheckbox();
1596
1596
 
@@ -1598,34 +1598,34 @@ function sampleCell() {
1598
1598
  const { Workbook, Color, TextAlignmentType } = require("aspose.cells.node");
1599
1599
 
1600
1600
  var excel = new Workbook();
1601
- var cells = excel.getWorksheets().get(0).getCells();
1601
+ var cells = excel.worksheets.get(0).cells;
1602
1602
 
1603
1603
  //Put a string into a cell
1604
1604
  var cell = cells.get(0, 0);
1605
1605
  cell.putValue("Hello");
1606
- var first = cell.getStringValue();
1606
+ var first = cell.stringValue;
1607
1607
  //Put an integer into a cell
1608
1608
  cell = cells.get("B1");
1609
1609
  cell.putValue(12);
1610
- var second = cell.getIntValue();
1610
+ var second = cell.intValue;
1611
1611
  //Put a double into a cell
1612
1612
  cell = cells.get(0, 2);
1613
1613
  cell.putValue(-1.234);
1614
- var third = cell.getDoubleValue();
1614
+ var third = cell.doubleValue;
1615
1615
  //Put a formula into a cell
1616
1616
  cell = cells.get("D1");
1617
- cell.setFormula("=B1 + C1");
1617
+ cell.formula = "=B1 + C1";
1618
1618
  //Put a combined formula: "sum(average(b1,c1), b1)" to cell at b2
1619
1619
  cell = cells.get("b2");
1620
- cell.setFormula("=sum(average(b1,c1), b1)");
1620
+ cell.formula = "=sum(average(b1,c1), b1)";
1621
1621
 
1622
1622
  //Set style of a cell
1623
1623
  var style = cell.getStyle();
1624
1624
  //Set background color
1625
- style.setBackgroundColor(Color.Yellow);
1625
+ style.backgroundColor = Color.Yellow;
1626
1626
  //Set format of a cell
1627
- style.getFont().setName("Courier New");
1628
- style.setVerticalAlignment(TextAlignmentType.Top);
1627
+ style.font.setName("Courier New");
1628
+ style.verticalAlignment = TextAlignmentType.Top;
1629
1629
  cell.setStyle(style);
1630
1630
  }
1631
1631
  sampleCell();
@@ -1634,23 +1634,23 @@ function sampleCellGetPrecedents() {
1634
1634
  const { Workbook, CellsHelper } = require("aspose.cells.node");
1635
1635
 
1636
1636
  var workbook = new Workbook();
1637
- var cells = workbook.getWorksheets().get(0).getCells();
1638
- cells.get("A1").setFormula("= B1 + SUM(B1:B10)");
1637
+ var cells = workbook.worksheets.get(0).cells;
1638
+ cells.get("A1").formula = "= B1 + SUM(B1:B10)";
1639
1639
  var areas = cells.get("A1").getPrecedents();
1640
- for (var i = 0; i < areas.getCount(); i++) {
1640
+ for (var i = 0; i < areas.count; i++) {
1641
1641
  var area = areas.get(i);
1642
1642
  var stringBuilder = "";
1643
- if (area.isExternalLink()) {
1643
+ if (area.isExternalLink) {
1644
1644
  stringBuilder += "[";
1645
- stringBuilder += area.getExternalFileName();
1645
+ stringBuilder += area.externalFileName;
1646
1646
  stringBuilder += "]";
1647
1647
  }
1648
- stringBuilder += area.getSheetName();
1648
+ stringBuilder += area.sheetName;
1649
1649
  stringBuilder += "!";
1650
- stringBuilder += CellsHelper.cellIndexToName(area.getStartRow(), area.getStartColumn());
1651
- if (area.isArea()) {
1650
+ stringBuilder += CellsHelper.cellIndexToName(area.startRow, area.startColumn);
1651
+ if (area.isArea) {
1652
1652
  stringBuilder += ":";
1653
- stringBuilder += CellsHelper.cellIndexToName(area.getEndRow(), area.getEndColumn());
1653
+ stringBuilder += CellsHelper.cellIndexToName(area.endRow, area.endColumn);
1654
1654
  }
1655
1655
  }
1656
1656
  workbook.save("output/CellGetPrecedents.xls");
@@ -1661,9 +1661,9 @@ function sampleCellCharactersIntInt() {
1661
1661
  const { Workbook, Color } = require("aspose.cells.node");
1662
1662
 
1663
1663
  var excel = new Workbook();
1664
- excel.getWorksheets().get(0).getCells().get("A1").putValue("Helloworld");
1665
- excel.getWorksheets().get(0).getCells().get("A1").characters(5, 5).getFont().setIsBold(true);
1666
- excel.getWorksheets().get(0).getCells().get("A1").characters(5, 5).getFont().setColor(Color.Blue);
1664
+ excel.worksheets.get(0).cells.get("A1").putValue("Helloworld");
1665
+ excel.worksheets.get(0).cells.get("A1").characters(5, 5).font.isBold = true;
1666
+ excel.worksheets.get(0).cells.get("A1").characters(5, 5).font.color = Color.Blue;
1667
1667
  }
1668
1668
  sampleCellCharactersIntInt();
1669
1669
 
@@ -1671,8 +1671,8 @@ function sampleCellFormula() {
1671
1671
  const { Workbook } = require("aspose.cells.node");
1672
1672
 
1673
1673
  var excel = new Workbook();
1674
- var cells = excel.getWorksheets().get(0).getCells();
1675
- cells.get("B6").setFormula("=SUM(B2:B5, E1) + sheet2!A1");
1674
+ var cells = excel.worksheets.get(0).cells;
1675
+ cells.get("B6").formula = "=SUM(B2:B5, E1) + sheet2!A1";
1676
1676
  }
1677
1677
  sampleCellFormula();
1678
1678
 
@@ -1682,17 +1682,17 @@ function sampleDrawingLabel() {
1682
1682
  //Create a new Workbook.
1683
1683
  var workbook = new Workbook();
1684
1684
  //Get the first worksheet in the workbook.
1685
- var sheet = workbook.getWorksheets().get(0);
1685
+ var sheet = workbook.worksheets.get(0);
1686
1686
  //Add a new label to the worksheet.
1687
- var label = sheet.getShapes().addShape(MsoDrawingType.Label, 2, 0, 2, 0, 60, 120);
1687
+ var label = sheet.shapes.addShape(MsoDrawingType.Label, 2, 0, 2, 0, 60, 120);
1688
1688
  //Set the caption of the label.
1689
- label.setText("This is a Label");
1689
+ label.text = "This is a Label";
1690
1690
  //Set the Placement Type, the way the
1691
1691
  //label is attached to the cells.
1692
- label.setPlacement(PlacementType.FreeFloating);
1692
+ label.placement = PlacementType.FreeFloating;
1693
1693
  //Set the fill color of the label.
1694
- label.getFill().setFillType(FillType.Solid);
1695
- label.getFill().getSolidFill().setColor(Color.Yellow);
1694
+ label.fill.fillType = FillType.Solid;
1695
+ label.fill.solidFill.color = Color.Yellow;
1696
1696
  //Saves the file.
1697
1697
  workbook.save("output/DrawingLabel.xls");
1698
1698
  }
@@ -1704,77 +1704,77 @@ function sampleDrawingGroupShape() {
1704
1704
  //Instantiate a new Workbook.
1705
1705
  var excelbook = new Workbook();
1706
1706
  //Add a group box to the first worksheet.
1707
- var box = excelbook.getWorksheets().get(0).getShapes().addGroupBox(1, 0, 1, 0, 300, 250);
1707
+ var box = excelbook.worksheets.get(0).shapes.addGroupBox(1, 0, 1, 0, 300, 250);
1708
1708
  //Set the caption of the group box.
1709
- box.setText("Age Groups");
1710
- box.setPlacement(PlacementType.FreeFloating);
1709
+ box.text = "Age Groups";
1710
+ box.placement = PlacementType.FreeFloating;
1711
1711
  //Make it 2-D box.
1712
- box.setShadow(false);
1712
+ box.shadow = false;
1713
1713
  //Add a radio button.
1714
- var radio1 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(3, 0, 2, 0, 30, 110);
1714
+ var radio1 = excelbook.worksheets.get(0).shapes.addRadioButton(3, 0, 2, 0, 30, 110);
1715
1715
  //Set its text string.
1716
- radio1.setText("20-29");
1716
+ radio1.text = "20-29";
1717
1717
  //Set A1 cell as a linked cell for the radio button.
1718
- radio1.setLinkedCell("A1");
1718
+ radio1.linkedCell = "A1";
1719
1719
  //Make the radio button 3-D.
1720
- radio1.setShadow(true);
1720
+ radio1.shadow = true;
1721
1721
  //Set the foreground color of the radio button.
1722
- radio1.getFill().setFillType(FillType.Solid);
1723
- radio1.getFill().getSolidFill().setColor(Color.LightGreen);
1722
+ radio1.fill.fillType = FillType.Solid;
1723
+ radio1.fill.solidFill.color = Color.LightGreen;
1724
1724
  //Set the line style of the radio button.
1725
- radio1.getLine().setCompoundType(MsoLineStyle.ThickThin);
1725
+ radio1.line.compoundType = MsoLineStyle.ThickThin;
1726
1726
  //Set the weight of the radio button.
1727
- radio1.getLine().setWeight(4);
1727
+ radio1.line.weight = 4;
1728
1728
  //Set the line color of the radio button.
1729
- radio1.getLine().setFillType(FillType.Solid);
1730
- radio1.getLine().getSolidFill().setColor(Color.Blue);
1729
+ radio1.line.fillType = FillType.Solid;
1730
+ radio1.line.solidFill.color = Color.Blue;
1731
1731
  //Set the dash style of the radio button.
1732
- radio1.getLine().setDashStyle(MsoLineDashStyle.Solid);
1732
+ radio1.line.dashStyle = MsoLineDashStyle.Solid;
1733
1733
  //Add another radio button.
1734
- var radio2 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(6, 0, 2, 0, 30, 110);
1734
+ var radio2 = excelbook.worksheets.get(0).shapes.addRadioButton(6, 0, 2, 0, 30, 110);
1735
1735
  //Set its text string.
1736
- radio2.setText("30-39");
1736
+ radio2.text = "30-39";
1737
1737
  //Set A1 cell as a linked cell for the radio button.
1738
- radio2.setLinkedCell("A1");
1738
+ radio2.linkedCell = "A1";
1739
1739
  //Make the radio button 3-D.
1740
- radio2.setShadow(true);
1740
+ radio2.shadow = true;
1741
1741
  //Set the foreground color of the radio button.
1742
- radio2.getFill().setFillType(FillType.Solid);
1743
- radio2.getFill().getSolidFill().setColor(Color.LightGreen);
1742
+ radio2.fill.fillType = FillType.Solid;
1743
+ radio2.fill.solidFill.color = Color.LightGreen;
1744
1744
  //Set the line style of the radio button.
1745
- radio2.getLine().setCompoundType(MsoLineStyle.ThickThin);
1745
+ radio2.line.compoundType = MsoLineStyle.ThickThin;
1746
1746
  //Set the weight of the radio button.
1747
- radio2.getLine().setWeight(4);
1747
+ radio2.line.weight = 4;
1748
1748
  //Set the line color of the radio button.
1749
- radio2.getLine().setFillType(FillType.Solid);
1750
- radio2.getLine().getSolidFill().setColor(Color.Blue);
1749
+ radio2.line.fillType = FillType.Solid;
1750
+ radio2.line.solidFill.color = Color.Blue;
1751
1751
  //Set the dash style of the radio button.
1752
- radio2.getLine().setDashStyle(MsoLineDashStyle.Solid);
1752
+ radio2.line.dashStyle = MsoLineDashStyle.Solid;
1753
1753
  //Add another radio button.
1754
- var radio3 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(9, 0, 2, 0, 30, 110);
1754
+ var radio3 = excelbook.worksheets.get(0).shapes.addRadioButton(9, 0, 2, 0, 30, 110);
1755
1755
  //Set its text string.
1756
- radio3.setText("40-49");
1756
+ radio3.text = "40-49";
1757
1757
  //Set A1 cell as a linked cell for the radio button.
1758
- radio3.setLinkedCell("A1");
1758
+ radio3.linkedCell = "A1";
1759
1759
  //Make the radio button 3-D.
1760
- radio3.setShadow(true);
1760
+ radio3.shadow = true;
1761
1761
  //Set the foreground color of the radio button.
1762
- radio3.getFill().setFillType(FillType.Solid);
1763
- radio3.getFill().getSolidFill().setColor(Color.LightGreen);
1762
+ radio3.fill.fillType = FillType.Solid;
1763
+ radio3.fill.solidFill.color = Color.LightGreen;
1764
1764
  //Set the line style of the radio button.
1765
- radio3.getLine().setCompoundType(MsoLineStyle.ThickThin);
1765
+ radio3.line.compoundType = MsoLineStyle.ThickThin;
1766
1766
  //Set the weight of the radio button.
1767
- radio3.getLine().setWeight(4);
1767
+ radio3.line.weight = 4;
1768
1768
  //Set the line color of the radio button.
1769
- radio3.getLine().setFillType(FillType.Solid);
1770
- radio3.getLine().getSolidFill().setColor(Color.Blue);
1769
+ radio3.line.fillType = FillType.Solid;
1770
+ radio3.line.solidFill.color = Color.Blue;
1771
1771
  //Set the dash style of the radio button.
1772
- radio3.getLine().setDashStyle(MsoLineDashStyle.Solid);
1772
+ radio3.line.dashStyle = MsoLineDashStyle.Solid;
1773
1773
 
1774
1774
  //Get the shapes.
1775
1775
  var shapeobjects = [ box, radio1, radio2, radio3 ];
1776
1776
  //Group the shapes.
1777
- var group = excelbook.getWorksheets().get(0).getShapes().group(shapeobjects);
1777
+ var group = excelbook.worksheets.get(0).shapes.group(shapeobjects);
1778
1778
 
1779
1779
  //Save the excel file.
1780
1780
  excelbook.save("output/DrawingGroupShape.xls");
@@ -1785,13 +1785,13 @@ function sampleCells() {
1785
1785
  const { Workbook } = require("aspose.cells.node");
1786
1786
 
1787
1787
  var excel = new Workbook();
1788
- var cells = excel.getWorksheets().get(0).getCells();
1788
+ var cells = excel.worksheets.get(0).cells;
1789
1789
  //Set default row height
1790
- cells.setStandardHeight(20);
1790
+ cells.standardHeight = 20;
1791
1791
  //Set row height
1792
1792
  cells.setRowHeight(2, 20.5);
1793
1793
  //Set default colum width
1794
- cells.setStandardWidth(15);
1794
+ cells.standardWidth = 15;
1795
1795
  //Set column width
1796
1796
  cells.setColumnWidth(3, 12.57);
1797
1797
  //Merge cells
@@ -1803,7 +1803,7 @@ function sampleCellsItemIntInt() {
1803
1803
  const { Workbook } = require("aspose.cells.node");
1804
1804
 
1805
1805
  var excel = new Workbook();
1806
- var cells = excel.getWorksheets().get(0).getCells();
1806
+ var cells = excel.worksheets.get(0).cells;
1807
1807
  var cell = cells.get(0, 0); //Gets the cell at "A1"
1808
1808
  }
1809
1809
  sampleCellsItemIntInt();
@@ -1812,7 +1812,7 @@ function sampleCellsItemString() {
1812
1812
  const { Workbook } = require("aspose.cells.node");
1813
1813
 
1814
1814
  var excel = new Workbook();
1815
- var cells = excel.getWorksheets().get(0).getCells();
1815
+ var cells = excel.worksheets.get(0).cells;
1816
1816
  var cell = cells.get("A1"); //Gets the cell at "A1"
1817
1817
  }
1818
1818
  sampleCellsItemString();
@@ -1821,13 +1821,13 @@ function sampleWorksheetCollection() {
1821
1821
  const { Workbook } = require("aspose.cells.node");
1822
1822
 
1823
1823
  var workbook = new Workbook();
1824
- var sheets = workbook.getWorksheets();
1824
+ var sheets = workbook.worksheets;
1825
1825
  //Add a worksheet
1826
1826
  sheets.add();
1827
1827
  //Change the name of a worksheet
1828
- sheets.get(0).setName("First Sheet");
1828
+ sheets.get(0).name = "First Sheet";
1829
1829
  //Set the active sheet to the second worksheet
1830
- sheets.setActiveSheetIndex(1);
1830
+ sheets.activeSheetIndex = 1;
1831
1831
  }
1832
1832
  sampleWorksheetCollection();
1833
1833
 
@@ -1835,17 +1835,17 @@ function sampleWorksheetCollectionAddSheetType() {
1835
1835
  const { Workbook, SheetType, ChartType } = require("aspose.cells.node");
1836
1836
 
1837
1837
  var workbook = new Workbook();
1838
- workbook.getWorksheets().add(SheetType.Chart);
1839
- var cells = workbook.getWorksheets().get(0).getCells();
1838
+ workbook.worksheets.add(SheetType.Chart);
1839
+ var cells = workbook.worksheets.get(0).cells;
1840
1840
  cells.get("c2").putValue(5000);
1841
1841
  cells.get("c3").putValue(3000);
1842
1842
  cells.get("c4").putValue(4000);
1843
1843
  cells.get("c5").putValue(5000);
1844
1844
  cells.get("c6").putValue(6000);
1845
- var charts = workbook.getWorksheets().get(1).getCharts();
1845
+ var charts = workbook.worksheets.get(1).charts;
1846
1846
  var chartIndex = charts.add(ChartType.Column, 10, 10, 20, 20);
1847
1847
  var chart = charts.get(chartIndex);
1848
- chart.getNSeries().add("Sheet1!C2:C6", true);
1848
+ chart.nSeries.add("Sheet1!C2:C6", true);
1849
1849
  }
1850
1850
  sampleWorksheetCollectionAddSheetType();
1851
1851
 
@@ -1853,8 +1853,8 @@ function sampleWorksheetCollectionBuiltInDocumentProperties() {
1853
1853
  const { Workbook } = require("aspose.cells.node");
1854
1854
 
1855
1855
  var workbook = new Workbook();
1856
- var doc = workbook.getWorksheets().getBuiltInDocumentProperties().get("Author");
1857
- doc.setValue("John Smith");
1856
+ var doc = workbook.worksheets.builtInDocumentProperties.get("Author");
1857
+ doc.value = "John Smith";
1858
1858
  }
1859
1859
  sampleWorksheetCollectionBuiltInDocumentProperties();
1860
1860
 
@@ -1862,7 +1862,7 @@ function sampleWorksheetCollectionCustomDocumentProperties() {
1862
1862
  const { Workbook } = require("aspose.cells.node");
1863
1863
 
1864
1864
  var excel = new Workbook();
1865
- excel.getWorksheets().getCustomDocumentProperties().add("Checked by", "Jane");
1865
+ excel.worksheets.customDocumentProperties.add("Checked by", "Jane");
1866
1866
  }
1867
1867
  sampleWorksheetCollectionCustomDocumentProperties();
1868
1868
 
@@ -1871,8 +1871,8 @@ function sampleVerticalPageBreak() {
1871
1871
 
1872
1872
  var excel = new Workbook();
1873
1873
  //Add a pagebreak at G5
1874
- excel.getWorksheets().get(0).getHorizontalPageBreaks().add("G5");
1875
- excel.getWorksheets().get(0).getVerticalPageBreaks().add("G5");
1874
+ excel.worksheets.get(0).horizontalPageBreaks.add("G5");
1875
+ excel.worksheets.get(0).verticalPageBreaks.add("G5");
1876
1876
  }
1877
1877
  sampleVerticalPageBreak();
1878
1878
 
@@ -1882,7 +1882,7 @@ function sampleExternalLinkCollection() {
1882
1882
  //Open a file with external links
1883
1883
  var workbook = new Workbook("input/Externlink.xls");
1884
1884
  //Change external link data source
1885
- workbook.getWorksheets().getExternalLinks().get(0).setDataSource("input/Book1.xls");
1885
+ workbook.worksheets.externalLinks.get(0).dataSource = "input/Book1.xls";
1886
1886
  }
1887
1887
  sampleExternalLinkCollection();
1888
1888
 
@@ -1892,33 +1892,33 @@ function sampleDrawingChartShape() {
1892
1892
  //Instantiating a Workbook object
1893
1893
  var workbook = new Workbook();
1894
1894
  //Obtaining the reference of the first worksheet
1895
- var worksheet = workbook.getWorksheets().get(0);
1895
+ var worksheet = workbook.worksheets.get(0);
1896
1896
  //Adding a sample value to "A1" cell
1897
- worksheet.getCells().get("A1").putValue(50);
1897
+ worksheet.cells.get("A1").putValue(50);
1898
1898
  //Adding a sample value to "A2" cell
1899
- worksheet.getCells().get("A2").putValue(100);
1899
+ worksheet.cells.get("A2").putValue(100);
1900
1900
  //Adding a sample value to "A3" cell
1901
- worksheet.getCells().get("A3").putValue(150);
1901
+ worksheet.cells.get("A3").putValue(150);
1902
1902
  //Adding a sample value to "B1" cell
1903
- worksheet.getCells().get("B1").putValue(60);
1903
+ worksheet.cells.get("B1").putValue(60);
1904
1904
  //Adding a sample value to "B2" cell
1905
- worksheet.getCells().get("B2").putValue(32);
1905
+ worksheet.cells.get("B2").putValue(32);
1906
1906
  //Adding a sample value to "B3" cell
1907
- worksheet.getCells().get("B3").putValue(50);
1907
+ worksheet.cells.get("B3").putValue(50);
1908
1908
  //Adding a chart to the worksheet
1909
- var chartIndex = worksheet.getCharts().add(ChartType.PieExploded, 5, 0, 25, 10);
1909
+ var chartIndex = worksheet.charts.add(ChartType.PieExploded, 5, 0, 25, 10);
1910
1910
  //Accessing the instance of the newly added chart
1911
- var chart = worksheet.getCharts().get(chartIndex);
1911
+ var chart = worksheet.charts.get(chartIndex);
1912
1912
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
1913
- chart.getNSeries().add("A1:B3", true);
1913
+ chart.nSeries.add("A1:B3", true);
1914
1914
  //Show Data Labels
1915
- chart.getNSeries().get(0).getDataLabels().setShowValue(true);
1915
+ chart.nSeries.get(0).dataLabels.showValue = true;
1916
1916
  //Getting Chart Shape
1917
- var chartShape = chart.getChartObject();
1917
+ var chartShape = chart.chartObject;
1918
1918
  //Set Lower Right Column
1919
- chartShape.setLowerRightColumn(10);
1919
+ chartShape.lowerRightColumn = 10;
1920
1920
  //Set LowerDeltaX
1921
- chartShape.setLowerDeltaX(1024);
1921
+ chartShape.lowerDeltaX = 1024;
1922
1922
  //Saving the Excel file
1923
1923
  workbook.save("output/DrawingChartShape.xls");
1924
1924
  }
@@ -1930,32 +1930,32 @@ function sampleChartsChartDataTable() {
1930
1930
  //Instantiating a Workbook object
1931
1931
  var workbook = new Workbook();
1932
1932
  //Obtaining the reference of the first worksheet
1933
- var worksheet = workbook.getWorksheets().get(0);
1933
+ var worksheet = workbook.worksheets.get(0);
1934
1934
  //Adding a sample value to "A1" cell
1935
- worksheet.getCells().get("A1").putValue(50);
1935
+ worksheet.cells.get("A1").putValue(50);
1936
1936
  //Adding a sample value to "A2" cell
1937
- worksheet.getCells().get("A2").putValue(100);
1937
+ worksheet.cells.get("A2").putValue(100);
1938
1938
  //Adding a sample value to "A3" cell
1939
- worksheet.getCells().get("A3").putValue(150);
1939
+ worksheet.cells.get("A3").putValue(150);
1940
1940
  //Adding a sample value to "B1" cell
1941
- worksheet.getCells().get("B1").putValue(60);
1941
+ worksheet.cells.get("B1").putValue(60);
1942
1942
  //Adding a sample value to "B2" cell
1943
- worksheet.getCells().get("B2").putValue(32);
1943
+ worksheet.cells.get("B2").putValue(32);
1944
1944
  //Adding a sample value to "B3" cell
1945
- worksheet.getCells().get("B3").putValue(50);
1945
+ worksheet.cells.get("B3").putValue(50);
1946
1946
  //Adding a chart to the worksheet
1947
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 25, 10);
1947
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 25, 10);
1948
1948
  //Accessing the instance of the newly added chart
1949
- var chart = worksheet.getCharts().get(chartIndex);
1949
+ var chart = worksheet.charts.get(chartIndex);
1950
1950
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
1951
- chart.getNSeries().add("A1:B3", true);
1952
- chart.setShowDataTable(true);
1951
+ chart.nSeries.add("A1:B3", true);
1952
+ chart.showDataTable = true;
1953
1953
  //Getting Chart Table
1954
1954
  var chartTable = chart.getChartDataTable();
1955
1955
  //Setting Chart Table Font Color
1956
- chartTable.getFont().setColor(Color.Red);
1956
+ chartTable.font.color = Color.Red;
1957
1957
  //Setting Legend Key Visibility
1958
- chartTable.setShowLegendKey(false);
1958
+ chartTable.showLegendKey = false;
1959
1959
  //Saving the Excel file
1960
1960
  workbook.save("output/ChartsChartDataTable.xls");
1961
1961
  }
@@ -1967,14 +1967,14 @@ function sampleRenderingImageOrPrintOptions() {
1967
1967
  //Set Image Or Print Options
1968
1968
  var options = new ImageOrPrintOptions();
1969
1969
  //set Horizontal resolution
1970
- options.setHorizontalResolution(200);
1970
+ options.horizontalResolution = 200;
1971
1971
  //set Vertica; Resolution
1972
- options.setVerticalResolution(300);
1972
+ options.verticalResolution = 300;
1973
1973
 
1974
1974
  //Instantiate Workbook
1975
1975
  var book = new Workbook("input/Chart.xls");
1976
1976
  //Save chart as Image using ImageOrPrint Options
1977
- book.getWorksheets().get(0).getCharts().get(0).toImage("output/chart.png", options);
1977
+ book.worksheets.get(0).charts.get(0).toImage("output/chart.png", options);
1978
1978
  }
1979
1979
  sampleRenderingImageOrPrintOptions();
1980
1980
 
@@ -1984,9 +1984,9 @@ function sampleName() {
1984
1984
  //Instantiating a Workbook object
1985
1985
  var workbook = new Workbook();
1986
1986
  //Accessing the first worksheet in the Excel file
1987
- var worksheet = workbook.getWorksheets().get(0);
1987
+ var worksheet = workbook.worksheets.get(0);
1988
1988
  //Creating a named range
1989
- var range = worksheet.getCells().createRange("B4", "G14");
1989
+ var range = worksheet.cells.createRange("B4", "G14");
1990
1990
  //Setting the name of the named range
1991
1991
  range.setName("TestRange");
1992
1992
  //Saving the modified Excel file in default (that is Excel 2000) format
@@ -2000,31 +2000,31 @@ function sampleChartsChartArea() {
2000
2000
  //Instantiating a Workbook object
2001
2001
  var workbook = new Workbook();
2002
2002
  //Obtaining the reference of the first worksheet
2003
- var worksheet = workbook.getWorksheets().get(0);
2003
+ var worksheet = workbook.worksheets.get(0);
2004
2004
  //Adding a sample value to "A1" cell
2005
- worksheet.getCells().get("A1").putValue(50);
2005
+ worksheet.cells.get("A1").putValue(50);
2006
2006
  //Adding a sample value to "A2" cell
2007
- worksheet.getCells().get("A2").putValue(100);
2007
+ worksheet.cells.get("A2").putValue(100);
2008
2008
  //Adding a sample value to "A3" cell
2009
- worksheet.getCells().get("A3").putValue(150);
2009
+ worksheet.cells.get("A3").putValue(150);
2010
2010
  //Adding a sample value to "B1" cell
2011
- worksheet.getCells().get("B1").putValue(60);
2011
+ worksheet.cells.get("B1").putValue(60);
2012
2012
  //Adding a sample value to "B2" cell
2013
- worksheet.getCells().get("B2").putValue(32);
2013
+ worksheet.cells.get("B2").putValue(32);
2014
2014
  //Adding a sample value to "B3" cell
2015
- worksheet.getCells().get("B3").putValue(50);
2015
+ worksheet.cells.get("B3").putValue(50);
2016
2016
  //Adding a chart to the worksheet
2017
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
2017
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
2018
2018
  //Accessing the instance of the newly added chart
2019
- var chart = worksheet.getCharts().get(chartIndex);
2019
+ var chart = worksheet.charts.get(chartIndex);
2020
2020
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
2021
- chart.getNSeries().add("A1:B3", true);
2021
+ chart.nSeries.add("A1:B3", true);
2022
2022
  //Getting Chart Area
2023
- var chartArea = chart.getChartArea();
2023
+ var chartArea = chart.chartArea;
2024
2024
  //Setting the foreground color of the chart area
2025
- chartArea.getArea().setForegroundColor(Color.Yellow);
2025
+ chartArea.getArea().foregroundColor = Color.Yellow;
2026
2026
  //Setting Chart Area Shadow
2027
- chartArea.setShadow(true);
2027
+ chartArea.shadow = true;
2028
2028
  //Saving the Excel file
2029
2029
  workbook.save("output/ChartsChartArea.xls");
2030
2030
  }
@@ -2034,8 +2034,8 @@ function sampleChartsChart() {
2034
2034
  const { Workbook, ChartType } = require("aspose.cells.node");
2035
2035
 
2036
2036
  var workbook = new Workbook();
2037
- var sheet = workbook.getWorksheets().get(0);
2038
- var cells = sheet.getCells();
2037
+ var sheet = workbook.worksheets.get(0);
2038
+ var cells = sheet.cells;
2039
2039
  cells.get(0, 1).putValue("Income");
2040
2040
  cells.get(1, 0).putValue("Company A");
2041
2041
  cells.get(2, 0).putValue("Company B");
@@ -2043,14 +2043,14 @@ function sampleChartsChart() {
2043
2043
  cells.get(1, 1).putValue(10000);
2044
2044
  cells.get(2, 1).putValue(20000);
2045
2045
  cells.get(3, 1).putValue(30000);
2046
- var chartIndex = sheet.getCharts().add(ChartType.Column, 9, 9, 21, 15);
2047
- var chart = sheet.getCharts().get(chartIndex);
2048
- chart.getNSeries().add("B2:B4", true);
2049
- chart.getNSeries().setCategoryData("A2:A4");
2050
- var aSeries = chart.getNSeries().get(0);
2051
- aSeries.setName("=B1");
2052
- chart.setShowLegend(true);
2053
- chart.getTitle().setText("Income Analysis");
2046
+ var chartIndex = sheet.charts.add(ChartType.Column, 9, 9, 21, 15);
2047
+ var chart = sheet.charts.get(chartIndex);
2048
+ chart.nSeries.add("B2:B4", true);
2049
+ chart.nSeries.categoryData = "A2:A4";
2050
+ var aSeries = chart.nSeries.get(0);
2051
+ aSeries.name = "=B1";
2052
+ chart.showLegend = true;
2053
+ chart.title.text = "Income Analysis";
2054
2054
  }
2055
2055
  sampleChartsChart();
2056
2056
 
@@ -2060,11 +2060,11 @@ function sampleChartsChartToImageImageOrPrintOptions() {
2060
2060
 
2061
2061
  var options = new ImageOrPrintOptions();
2062
2062
  options.setImageType(ImageType.Jpeg);
2063
- options.setHorizontalResolution(400);
2064
- options.setVerticalResolution(300);
2063
+ options.horizontalResolution = 400;
2064
+ options.verticalResolution = 300;
2065
2065
 
2066
2066
  var book = new Workbook("input/Chart.xls");
2067
- var uint8Array = book.getWorksheets().get(0).getCharts().get(0).toImage(options);
2067
+ var uint8Array = book.worksheets.get(0).charts.get(0).toImage(options);
2068
2068
  const buffer = Buffer.from(uint8Array);
2069
2069
  fs.writeFileSync("output/chart-stream.jpg", buffer);
2070
2070
  }
@@ -2074,12 +2074,12 @@ function sampleChartsChartToImageStringImageOrPrintOptions() {
2074
2074
  const { Workbook, ImageOrPrintOptions } = require("aspose.cells.node");
2075
2075
 
2076
2076
  var options = new ImageOrPrintOptions();
2077
- options.setHorizontalResolution(400);
2078
- options.setVerticalResolution(300);
2079
- options.setQuality(80);
2077
+ options.horizontalResolution = 400;
2078
+ options.verticalResolution = 300;
2079
+ options.quality = 80;
2080
2080
 
2081
2081
  var book = new Workbook("input/Chart.xls");
2082
- book.getWorksheets().get(0).getCharts().get(0).toImage("output/chart-r-400x300.png", options);
2082
+ book.worksheets.get(0).charts.get(0).toImage("output/chart-r-400x300.png", options);
2083
2083
  }
2084
2084
  sampleChartsChartToImageStringImageOrPrintOptions();
2085
2085
 
@@ -2089,19 +2089,19 @@ function sampleFontSetting() {
2089
2089
  //Instantiating a Workbook object
2090
2090
  var workbook = new Workbook();
2091
2091
  //Adding a new worksheet to the Excel object
2092
- workbook.getWorksheets().add();
2092
+ workbook.worksheets.add();
2093
2093
  //Obtaining the reference of the newly added worksheet by passing its sheet index
2094
- var worksheet = workbook.getWorksheets().get(0);
2094
+ var worksheet = workbook.worksheets.get(0);
2095
2095
  //Accessing the "A1" cell from the worksheet
2096
- var cell = worksheet.getCells().get("A1");
2096
+ var cell = worksheet.cells.get("A1");
2097
2097
  //Adding some value to the "A1" cell
2098
2098
  cell.putValue("Visit Aspose!");
2099
2099
  //getting charactor
2100
2100
  var charactor = cell.characters(6, 7);
2101
2101
  //Setting the font of selected characters to bold
2102
- charactor.getFont().setIsBold(true);
2102
+ charactor.font.isBold = true;
2103
2103
  //Setting the font color of selected characters to blue
2104
- charactor.getFont().setColor(Color.Blue);
2104
+ charactor.font.color = Color.Blue;
2105
2105
  //Saving the Excel file
2106
2106
  workbook.save("output/FontSetting.xls");
2107
2107
  }
@@ -2113,29 +2113,29 @@ function sampleDrawingLineShape() {
2113
2113
  //Instantiate a new Workbook.
2114
2114
  var workbook = new Workbook();
2115
2115
  //Get the first worksheet in the book.
2116
- var worksheet = workbook.getWorksheets().get(0);
2116
+ var worksheet = workbook.worksheets.get(0);
2117
2117
  //Add a new line to the worksheet.
2118
- var line1 = worksheet.getShapes().addLine(5, 0, 1, 0, 0, 250);
2118
+ var line1 = worksheet.shapes.addLine(5, 0, 1, 0, 0, 250);
2119
2119
  //Set the line dash style
2120
- line1.getLine().setDashStyle(MsoLineDashStyle.Solid);
2120
+ line1.line.dashStyle = MsoLineDashStyle.Solid;
2121
2121
  //Set the placement.
2122
- line1.setPlacement(PlacementType.FreeFloating);
2122
+ line1.placement = PlacementType.FreeFloating;
2123
2123
  //Add another line to the worksheet.
2124
- var line2 = worksheet.getShapes().addLine(7, 0, 1, 0, 85, 250);
2124
+ var line2 = worksheet.shapes.addLine(7, 0, 1, 0, 85, 250);
2125
2125
  //Set the line dash style.
2126
- line2.getLine().setDashStyle(MsoLineDashStyle.DashLongDash);
2126
+ line2.line.dashStyle = MsoLineDashStyle.DashLongDash;
2127
2127
  //Set the weight of the line.
2128
- line2.getLine().setWeight(4);
2128
+ line2.line.weight = 4;
2129
2129
  //Set the placement.
2130
- line2.setPlacement(PlacementType.FreeFloating);
2130
+ line2.placement = PlacementType.FreeFloating;
2131
2131
  //Add the third line to the worksheet.
2132
- var line3 = worksheet.getShapes().addShape(MsoDrawingType.Line, 13, 0, 1, 0, 0, 250);
2132
+ var line3 = worksheet.shapes.addShape(MsoDrawingType.Line, 13, 0, 1, 0, 0, 250);
2133
2133
  //Set the line dash style
2134
- line3.getLine().setDashStyle(MsoLineDashStyle.Solid);
2134
+ line3.line.dashStyle = MsoLineDashStyle.Solid;
2135
2135
  //Set the placement.
2136
- line3.setPlacement(PlacementType.FreeFloating);
2136
+ line3.placement = PlacementType.FreeFloating;
2137
2137
  //Make the gridlines invisible in the first worksheet.
2138
- workbook.getWorksheets().get(0).setIsGridlinesVisible(false);
2138
+ workbook.worksheets.get(0).isGridlinesVisible = false;
2139
2139
  //Save the excel file.
2140
2140
  workbook.save("output/DrawingLineShape.xls");
2141
2141
  }
@@ -2147,76 +2147,76 @@ function sampleDrawingGroupBox() {
2147
2147
  //Instantiate a new Workbook.
2148
2148
  var excelbook = new Workbook();
2149
2149
  //Add a group box to the first worksheet.
2150
- var box = excelbook.getWorksheets().get(0).getShapes().addGroupBox(1, 0, 1, 0, 300, 250);
2150
+ var box = excelbook.worksheets.get(0).shapes.addGroupBox(1, 0, 1, 0, 300, 250);
2151
2151
  //Set the caption of the group box.
2152
- box.setText("Age Groups");
2153
- box.setPlacement(PlacementType.FreeFloating);
2152
+ box.text = "Age Groups";
2153
+ box.placement = PlacementType.FreeFloating;
2154
2154
  //Make it 2-D box.
2155
- box.setShadow(false);
2155
+ box.shadow = false;
2156
2156
  //Add a radio button.
2157
- var radio1 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(3, 0, 2, 0, 30, 110);
2157
+ var radio1 = excelbook.worksheets.get(0).shapes.addRadioButton(3, 0, 2, 0, 30, 110);
2158
2158
  //Set its text string.
2159
- radio1.setText("20-29");
2159
+ radio1.text = "20-29";
2160
2160
  //Set A1 cell as a linked cell for the radio button.
2161
- radio1.setLinkedCell("A1");
2161
+ radio1.linkedCell = "A1";
2162
2162
  //Make the radio button 3-D.
2163
- radio1.setShadow(true);
2163
+ radio1.shadow = true;
2164
2164
  //Set the foreground color of the radio button.
2165
- radio1.getFill().setFillType(FillType.Solid);
2166
- radio1.getFill().getSolidFill().setColor(Color.LightGreen);
2165
+ radio1.fill.fillType = FillType.Solid;
2166
+ radio1.fill.solidFill.color = Color.LightGreen;
2167
2167
  //Set the line style of the radio button.
2168
- radio1.getLine().setCompoundType(MsoLineStyle.ThickThin);
2168
+ radio1.line.compoundType = MsoLineStyle.ThickThin;
2169
2169
  //Set the weight of the radio button.
2170
- radio1.getLine().setWeight(4);
2170
+ radio1.line.weight = 4;
2171
2171
  //Set the line color of the radio button.
2172
- radio1.getLine().setFillType(FillType.Solid);
2173
- radio1.getLine().getSolidFill().setColor(Color.Blue);
2172
+ radio1.line.fillType = FillType.Solid;
2173
+ radio1.line.solidFill.color = Color.Blue;
2174
2174
  //Set the dash style of the radio button.
2175
- radio1.getLine().setDashStyle(MsoLineDashStyle.Solid);
2175
+ radio1.line.dashStyle = MsoLineDashStyle.Solid;
2176
2176
  //Add another radio button.
2177
- var radio2 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(6, 0, 2, 0, 30, 110);
2177
+ var radio2 = excelbook.worksheets.get(0).shapes.addRadioButton(6, 0, 2, 0, 30, 110);
2178
2178
  //Set its text string.
2179
- radio2.setText("30-39");
2179
+ radio2.text = "30-39";
2180
2180
  //Set A1 cell as a linked cell for the radio button.
2181
- radio2.setLinkedCell("A1");
2181
+ radio2.linkedCell = "A1";
2182
2182
  //Make the radio button 3-D.
2183
- radio2.setShadow(true);
2183
+ radio2.shadow = true;
2184
2184
  //Set the foreground color of the radio button.
2185
- radio2.getFill().setFillType(FillType.Solid);
2186
- radio2.getFill().getSolidFill().setColor(Color.LightGreen);
2185
+ radio2.fill.fillType = FillType.Solid;
2186
+ radio2.fill.solidFill.color = Color.LightGreen;
2187
2187
  //Set the line style of the radio button.
2188
- radio2.getLine().setCompoundType(MsoLineStyle.ThickThin);
2188
+ radio2.line.compoundType = MsoLineStyle.ThickThin;
2189
2189
  //Set the weight of the radio button.
2190
- radio2.getLine().setWeight(4);
2190
+ radio2.line.weight = 4;
2191
2191
  //Set the line color of the radio button.
2192
- radio2.getLine().setFillType(FillType.Solid);
2193
- radio2.getLine().getSolidFill().setColor(Color.Blue);
2192
+ radio2.line.fillType = FillType.Solid;
2193
+ radio2.line.solidFill.color = Color.Blue;
2194
2194
  //Set the dash style of the radio button.
2195
- radio2.getLine().setDashStyle(MsoLineDashStyle.Solid);
2195
+ radio2.line.dashStyle = MsoLineDashStyle.Solid;
2196
2196
  //Add another radio button.
2197
- var radio3 = excelbook.getWorksheets().get(0).getShapes().addRadioButton(9, 0, 2, 0, 30, 110);
2197
+ var radio3 = excelbook.worksheets.get(0).shapes.addRadioButton(9, 0, 2, 0, 30, 110);
2198
2198
  //Set its text string.
2199
- radio3.setText("40-49");
2199
+ radio3.text = "40-49";
2200
2200
  //Set A1 cell as a linked cell for the radio button.
2201
- radio3.setLinkedCell("A1");
2201
+ radio3.linkedCell = "A1";
2202
2202
  //Make the radio button 3-D.
2203
- radio3.setShadow(true);
2203
+ radio3.shadow = true;
2204
2204
  //Set the foreground color of the radio button.
2205
- radio3.getFill().setFillType(FillType.Solid);
2206
- radio3.getFill().getSolidFill().setColor(Color.LightGreen);
2205
+ radio3.fill.fillType = FillType.Solid;
2206
+ radio3.fill.solidFill.color = Color.LightGreen;
2207
2207
  //Set the line style of the radio button.
2208
- radio3.getLine().setCompoundType(MsoLineStyle.ThickThin);
2208
+ radio3.line.compoundType = MsoLineStyle.ThickThin;
2209
2209
  //Set the weight of the radio button.
2210
- radio3.getLine().setWeight(4);
2210
+ radio3.line.weight = 4;
2211
2211
  //Set the line color of the radio button.
2212
- radio3.getLine().setFillType(FillType.Solid);
2213
- radio3.getLine().getSolidFill().setColor(Color.Blue);
2212
+ radio3.line.fillType = FillType.Solid;
2213
+ radio3.line.solidFill.color = Color.Blue;
2214
2214
  //Set the dash style of the radio button.
2215
- radio3.getLine().setDashStyle(MsoLineDashStyle.Solid);
2215
+ radio3.line.dashStyle = MsoLineDashStyle.Solid;
2216
2216
  //Get the shapes.
2217
2217
  var shapeobjects = [ box, radio1, radio2, radio3 ];
2218
2218
  //Group the shapes.
2219
- var group = excelbook.getWorksheets().get(0).getShapes().group(shapeobjects);
2219
+ var group = excelbook.worksheets.get(0).shapes.group(shapeobjects);
2220
2220
 
2221
2221
  //Save the excel file.
2222
2222
  excelbook.save("output/DrawingGroupBox.xls");
@@ -2229,19 +2229,19 @@ function sampleFont() {
2229
2229
  //Instantiating a Workbook object
2230
2230
  var workbook = new Workbook();
2231
2231
  //Obtaining the reference of the newly added worksheet by passing its sheet index
2232
- var worksheet = workbook.getWorksheets().get(0);
2232
+ var worksheet = workbook.worksheets.get(0);
2233
2233
  //Accessing the "A1" cell from the worksheet
2234
- var cell = worksheet.getCells().get("A1");
2234
+ var cell = worksheet.cells.get("A1");
2235
2235
  //Adding some value to the "A1" cell
2236
2236
  cell.putValue("Hello Aspose!");
2237
2237
  var style = cell.getStyle();
2238
- var font = style.getFont();
2238
+ var font = style.font;
2239
2239
  //Setting the font name to "Times New Roman"
2240
2240
  font.setName("Times New Roman");
2241
2241
  //Setting font size to 14
2242
2242
  font.setSize(14);
2243
2243
  //setting font color as Red
2244
- font.setColor(Color.Red);
2244
+ font.color = Color.Red;
2245
2245
  cell.setStyle(style);
2246
2246
  //Saving the Excel file
2247
2247
  workbook.save("output/Font.xls");
@@ -2253,13 +2253,13 @@ function sampleFontName() {
2253
2253
 
2254
2254
  var workbook = new Workbook();
2255
2255
  //Obtaining the reference of the newly added worksheet by passing its sheet index
2256
- var worksheet = workbook.getWorksheets().get(0);
2256
+ var worksheet = workbook.worksheets.get(0);
2257
2257
  //Accessing the "A1" cell from the worksheet
2258
- var cell = worksheet.getCells().get("A1");
2258
+ var cell = worksheet.cells.get("A1");
2259
2259
  //Adding some value to the "A1" cell
2260
2260
  cell.putValue("Hello Aspose!");
2261
2261
  var style = cell.getStyle();
2262
- var font = style.getFont();
2262
+ var font = style.font;
2263
2263
  font.setName("Times New Roman");
2264
2264
  cell.setStyle(style);
2265
2265
  }
@@ -2270,9 +2270,9 @@ function sampleConditionalFormattingCollection() {
2270
2270
 
2271
2271
  //Instantiating a Workbook object
2272
2272
  var workbook = new Workbook();
2273
- var sheet = workbook.getWorksheets().get(0);
2273
+ var sheet = workbook.worksheets.get(0);
2274
2274
  //Get Conditional Formattings
2275
- var cformattings = sheet.getConditionalFormattings();
2275
+ var cformattings = sheet.conditionalFormattings;
2276
2276
  //Adds an empty conditional formatting
2277
2277
  var index = cformattings.add();
2278
2278
  //Get newly added Conditional formatting
@@ -2296,7 +2296,7 @@ function sampleConditionalFormattingCollection() {
2296
2296
  var conditionIndex2 = fcs.addCondition(FormatConditionType.CellValue, OperatorType.Between, "50", "100");
2297
2297
  //Sets the background color.
2298
2298
  var fc = fcs.get(conditionIndex);
2299
- fc.getStyle().setBackgroundColor(Color.Red);
2299
+ fc.style.backgroundColor = Color.Red;
2300
2300
  //Saving the Excel file
2301
2301
  workbook.save("output/ConditionalFormattingCollection.xls");
2302
2302
  }
@@ -2308,13 +2308,13 @@ function sampleDrawingComboBox() {
2308
2308
  //Create a new Workbook.
2309
2309
  var workbook = new Workbook();
2310
2310
  //Get the first worksheet.
2311
- var sheet = workbook.getWorksheets().get(0);
2311
+ var sheet = workbook.worksheets.get(0);
2312
2312
  //Get the worksheet cells collection.
2313
- var cells = sheet.getCells();
2313
+ var cells = sheet.cells;
2314
2314
  //Input a value.
2315
2315
  cells.get("B3").putValue("Employee:");
2316
2316
  //Set it bold.
2317
- cells.get("B3").getStyle().getFont().setIsBold(true);
2317
+ cells.get("B3").getStyle().font.isBold = true;
2318
2318
  //Input some values that denote the input range
2319
2319
  //for the combo box.
2320
2320
  cells.get("A2").putValue("Emp001");
@@ -2325,16 +2325,16 @@ function sampleDrawingComboBox() {
2325
2325
  cells.get("A7").putValue("Emp006");
2326
2326
 
2327
2327
  //Add a new combo box.
2328
- var comboBox = sheet.getShapes().addComboBox(2, 0, 2, 0, 22, 100);
2328
+ var comboBox = sheet.shapes.addComboBox(2, 0, 2, 0, 22, 100);
2329
2329
  //Set the linked cell;
2330
- comboBox.setLinkedCell("A1");
2330
+ comboBox.linkedCell = "A1";
2331
2331
  //Set the input range.
2332
- comboBox.setInputRange("A2:A7");
2332
+ comboBox.inputRange = "A2:A7";
2333
2333
  //Set no. of list lines displayed in the combo
2334
2334
  //box's list portion.
2335
- comboBox.setDropDownLines(5);
2335
+ comboBox.dropDownLines = 5;
2336
2336
  //Set the combo box with 3-D shading.
2337
- comboBox.setShadow(true);
2337
+ comboBox.shadow = true;
2338
2338
  //AutoFit Columns
2339
2339
  sheet.autoFitColumns();
2340
2340
  //Saves the file.
@@ -2348,26 +2348,26 @@ function sampleColumnCollection() {
2348
2348
  //Instantiating a Workbook object
2349
2349
  var workbook = new Workbook();
2350
2350
  //Obtaining the reference of the first worksheet
2351
- var worksheet = workbook.getWorksheets().get(0);
2351
+ var worksheet = workbook.worksheets.get(0);
2352
2352
  //Add new Style to Workbook
2353
2353
  var style = workbook.createStyle();
2354
2354
  //Setting the background color to Blue
2355
- style.setForegroundColor(Color.Blue);
2355
+ style.foregroundColor = Color.Blue;
2356
2356
  //setting Background Pattern
2357
- style.setPattern(BackgroundType.Solid);
2357
+ style.pattern = BackgroundType.Solid;
2358
2358
  //New Style Flag
2359
2359
  var styleFlag = new StyleFlag();
2360
2360
  //Set All Styles
2361
- styleFlag.setAll(true);
2361
+ styleFlag.all = true;
2362
2362
 
2363
2363
  //Change the default width of first ten columns
2364
2364
  for (var i = 0; i < 10; i++) {
2365
- worksheet.getCells().getColumns().get(i).setWidth(20);
2365
+ worksheet.cells.columns.get(i).width = 20;
2366
2366
  }
2367
2367
 
2368
2368
  //Get the Column with non default formatting
2369
- var columns = worksheet.getCells().getColumns();
2370
- var count = columns.getCount();
2369
+ var columns = worksheet.cells.columns;
2370
+ var count = columns.count;
2371
2371
  for (var i = 0; i < count; i++) {
2372
2372
  var column = columns.getColumnByIndex(i);
2373
2373
  //Apply Style to first ten Columns
@@ -2385,7 +2385,7 @@ function sampleFindOptions() {
2385
2385
  //Instantiate the workbook object
2386
2386
  var workbook = new Workbook("input/Book1.xls");
2387
2387
  //Get Cells collection
2388
- var cells = workbook.getWorksheets().get(0).getCells();
2388
+ var cells = workbook.worksheets.get(0).cells;
2389
2389
  //Instantiate FindOptions Object
2390
2390
  var findOptions = new FindOptions();
2391
2391
  //Create a Cells Area
@@ -2398,9 +2398,9 @@ function sampleFindOptions() {
2398
2398
  //Set cells area for find options
2399
2399
  findOptions.setRange(ca);
2400
2400
  //Set searching properties
2401
- findOptions.setSearchBackward(false);
2402
- findOptions.setSearchOrderByRows(true);
2403
- findOptions.setLookInType(LookInType.Values);
2401
+ findOptions.searchBackward = false;
2402
+ findOptions.searchOrderByRows = true;
2403
+ findOptions.lookInType = LookInType.Values;
2404
2404
  //Find the cell with 0 value
2405
2405
  var cell = cells.find(0, null, findOptions);
2406
2406
  }
@@ -2412,51 +2412,51 @@ function sampleChartsSeries() {
2412
2412
  //Instantiating a Workbook object
2413
2413
  var workbook = new Workbook();
2414
2414
  //Adding a new worksheet to the Excel object
2415
- var sheetIndex = workbook.getWorksheets().add();
2415
+ var sheetIndex = workbook.worksheets.add();
2416
2416
  //Obtaining the reference of the newly added worksheet by passing its sheet index
2417
- var worksheet = workbook.getWorksheets().get(sheetIndex);
2417
+ var worksheet = workbook.worksheets.get(sheetIndex);
2418
2418
  //Adding a sample value to "A1" cell
2419
- worksheet.getCells().get("A1").putValue(50);
2419
+ worksheet.cells.get("A1").putValue(50);
2420
2420
  //Adding a sample value to "A2" cell
2421
- worksheet.getCells().get("A2").putValue(100);
2421
+ worksheet.cells.get("A2").putValue(100);
2422
2422
  //Adding a sample value to "A3" cell
2423
- worksheet.getCells().get("A3").putValue(150);
2423
+ worksheet.cells.get("A3").putValue(150);
2424
2424
  //Adding a sample value to "A4" cell
2425
- worksheet.getCells().get("A4").putValue(200);
2425
+ worksheet.cells.get("A4").putValue(200);
2426
2426
  //Adding a sample value to "B1" cell
2427
- worksheet.getCells().get("B1").putValue(60);
2427
+ worksheet.cells.get("B1").putValue(60);
2428
2428
  //Adding a sample value to "B2" cell
2429
- worksheet.getCells().get("B2").putValue(32);
2429
+ worksheet.cells.get("B2").putValue(32);
2430
2430
  //Adding a sample value to "B3" cell
2431
- worksheet.getCells().get("B3").putValue(50);
2431
+ worksheet.cells.get("B3").putValue(50);
2432
2432
  //Adding a sample value to "B4" cell
2433
- worksheet.getCells().get("B4").putValue(40);
2433
+ worksheet.cells.get("B4").putValue(40);
2434
2434
  //Adding a sample value to "C1" cell as category data
2435
- worksheet.getCells().get("C1").putValue("Q1");
2435
+ worksheet.cells.get("C1").putValue("Q1");
2436
2436
  //Adding a sample value to "C2" cell as category data
2437
- worksheet.getCells().get("C2").putValue("Q2");
2437
+ worksheet.cells.get("C2").putValue("Q2");
2438
2438
  //Adding a sample value to "C3" cell as category data
2439
- worksheet.getCells().get("C3").putValue("Y1");
2439
+ worksheet.cells.get("C3").putValue("Y1");
2440
2440
  //Adding a sample value to "C4" cell as category data
2441
- worksheet.getCells().get("C4").putValue("Y2");
2441
+ worksheet.cells.get("C4").putValue("Y2");
2442
2442
  //Adding a chart to the worksheet
2443
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
2443
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
2444
2444
  //Accessing the instance of the newly added chart
2445
- var chart = worksheet.getCharts().get(chartIndex);
2445
+ var chart = worksheet.charts.get(chartIndex);
2446
2446
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
2447
- chart.getNSeries().add("A1:B4", true);
2447
+ chart.nSeries.add("A1:B4", true);
2448
2448
  //Setting the data source for the category data of NSeries
2449
- chart.getNSeries().setCategoryData("C1:C4");
2450
- var series = chart.getNSeries().get(1);
2449
+ chart.nSeries.categoryData = "C1:C4";
2450
+ var series = chart.nSeries.get(1);
2451
2451
  //Setting the values of the series.
2452
- series.setValues("=B1:B4");
2452
+ series.values = "=B1:B4";
2453
2453
  //Changing the chart type of the series.
2454
- series.setType(ChartType.Line);
2454
+ series.type = ChartType.Line;
2455
2455
  //Setting marker properties.
2456
- series.getMarker().setMarkerStyle(ChartMarkerType.Circle);
2457
- series.getMarker().setForegroundColorSetType(FormattingType.Automatic);
2458
- series.getMarker().setForegroundColor(Color.Black);
2459
- series.getMarker().setBackgroundColorSetType(FormattingType.Automatic);
2456
+ series.marker.markerStyle = ChartMarkerType.Circle;
2457
+ series.marker.foregroundColorSetType = FormattingType.Automatic;
2458
+ series.marker.foregroundColor = Color.Black;
2459
+ series.marker.backgroundColorSetType = FormattingType.Automatic;
2460
2460
  //Saving the Excel file
2461
2461
  workbook.save("output/ChartsSeries.xls");
2462
2462
  }
@@ -2467,17 +2467,17 @@ function sampleChartsSeriesName() {
2467
2467
 
2468
2468
  var workbook = new Workbook();
2469
2469
  //Get the first worksheet.
2470
- var worksheet = workbook.getWorksheets().get(0);
2470
+ var worksheet = workbook.worksheets.get(0);
2471
2471
  //Adding a chart to the worksheet
2472
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
2472
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
2473
2473
  //Accessing the instance of the newly added chart
2474
- var chart = worksheet.getCharts().get(chartIndex);
2474
+ var chart = worksheet.charts.get(chartIndex);
2475
2475
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
2476
- chart.getNSeries().add("A1:B4", true);
2476
+ chart.nSeries.add("A1:B4", true);
2477
2477
  //Reference name to a cell
2478
- chart.getNSeries().get(0).setName("=A1");
2478
+ chart.nSeries.get(0).name = "=A1";
2479
2479
  //Set a string to name
2480
- chart.getNSeries().get(0).setName("First Series");
2480
+ chart.nSeries.get(0).name = "First Series";
2481
2481
  }
2482
2482
  sampleChartsSeriesName();
2483
2483
 
@@ -2485,14 +2485,14 @@ function sampleChartsTrendlineCollection() {
2485
2485
  const { Workbook, ChartType, TrendlineType, Color } = require("aspose.cells.node");
2486
2486
 
2487
2487
  var excel = new Workbook();
2488
- var chartIndex = excel.getWorksheets().get(0).getCharts().add(ChartType.Column, 3, 3, 15, 10);
2489
- var chart = excel.getWorksheets().get(0).getCharts().get(chartIndex);
2490
- chart.getNSeries().add("A1:a3", true);
2491
- chart.getNSeries().get(0).getTrendLines().add(TrendlineType.Linear, "MyTrendLine");
2492
- var line = chart.getNSeries().get(0).getTrendLines().get(0);
2493
- line.setDisplayEquation(true);
2494
- line.setDisplayRSquared(true);
2495
- line.setColor(Color.Red);
2488
+ var chartIndex = excel.worksheets.get(0).charts.add(ChartType.Column, 3, 3, 15, 10);
2489
+ var chart = excel.worksheets.get(0).charts.get(chartIndex);
2490
+ chart.nSeries.add("A1:a3", true);
2491
+ chart.nSeries.get(0).trendLines.add(TrendlineType.Linear, "MyTrendLine");
2492
+ var line = chart.nSeries.get(0).trendLines.get(0);
2493
+ line.displayEquation = true;
2494
+ line.displayRSquared = true;
2495
+ line.color = Color.Red;
2496
2496
  }
2497
2497
  sampleChartsTrendlineCollection();
2498
2498
 
@@ -2502,50 +2502,50 @@ function sampleChartsTrendline() {
2502
2502
  //Instantiating a Workbook object
2503
2503
  var workbook = new Workbook();
2504
2504
  //Adding a new worksheet to the Excel object
2505
- var sheetIndex = workbook.getWorksheets().add();
2505
+ var sheetIndex = workbook.worksheets.add();
2506
2506
  //Obtaining the reference of the newly added worksheet by passing its sheet index
2507
- var worksheet = workbook.getWorksheets().get(sheetIndex);
2507
+ var worksheet = workbook.worksheets.get(sheetIndex);
2508
2508
  //Adding a sample value to "A1" cell
2509
- worksheet.getCells().get("A1").putValue(50);
2509
+ worksheet.cells.get("A1").putValue(50);
2510
2510
  //Adding a sample value to "A2" cell
2511
- worksheet.getCells().get("A2").putValue(100);
2511
+ worksheet.cells.get("A2").putValue(100);
2512
2512
  //Adding a sample value to "A3" cell
2513
- worksheet.getCells().get("A3").putValue(150);
2513
+ worksheet.cells.get("A3").putValue(150);
2514
2514
  //Adding a sample value to "A4" cell
2515
- worksheet.getCells().get("A4").putValue(200);
2515
+ worksheet.cells.get("A4").putValue(200);
2516
2516
  //Adding a sample value to "B1" cell
2517
- worksheet.getCells().get("B1").putValue(60);
2517
+ worksheet.cells.get("B1").putValue(60);
2518
2518
  //Adding a sample value to "B2" cell
2519
- worksheet.getCells().get("B2").putValue(32);
2519
+ worksheet.cells.get("B2").putValue(32);
2520
2520
  //Adding a sample value to "B3" cell
2521
- worksheet.getCells().get("B3").putValue(50);
2521
+ worksheet.cells.get("B3").putValue(50);
2522
2522
  //Adding a sample value to "B4" cell
2523
- worksheet.getCells().get("B4").putValue(40);
2523
+ worksheet.cells.get("B4").putValue(40);
2524
2524
  //Adding a sample value to "C1" cell as category data
2525
- worksheet.getCells().get("C1").putValue("Q1");
2525
+ worksheet.cells.get("C1").putValue("Q1");
2526
2526
  //Adding a sample value to "C2" cell as category data
2527
- worksheet.getCells().get("C2").putValue("Q2");
2527
+ worksheet.cells.get("C2").putValue("Q2");
2528
2528
  //Adding a sample value to "C3" cell as category data
2529
- worksheet.getCells().get("C3").putValue("Y1");
2529
+ worksheet.cells.get("C3").putValue("Y1");
2530
2530
  //Adding a sample value to "C4" cell as category data
2531
- worksheet.getCells().get("C4").putValue("Y2");
2531
+ worksheet.cells.get("C4").putValue("Y2");
2532
2532
  //Adding a chart to the worksheet
2533
- var chartIndex = worksheet.getCharts().add(ChartType.Column, 5, 0, 15, 5);
2533
+ var chartIndex = worksheet.charts.add(ChartType.Column, 5, 0, 15, 5);
2534
2534
  //Accessing the instance of the newly added chart
2535
- var chart = worksheet.getCharts().get(chartIndex);
2535
+ var chart = worksheet.charts.get(chartIndex);
2536
2536
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
2537
- chart.getNSeries().add("A1:B4", true);
2537
+ chart.nSeries.add("A1:B4", true);
2538
2538
  //Setting the data source for the category data of NSeries
2539
- chart.getNSeries().setCategoryData("C1:C4");
2539
+ chart.nSeries.categoryData = "C1:C4";
2540
2540
  //adding a linear trendline
2541
- var index = chart.getNSeries().get(0).getTrendLines().add(TrendlineType.Linear);
2542
- var trendline = chart.getNSeries().get(0).getTrendLines().get(index);
2541
+ var index = chart.nSeries.get(0).trendLines.add(TrendlineType.Linear);
2542
+ var trendline = chart.nSeries.get(0).trendLines.get(index);
2543
2543
  //Setting the custom name of the trendline.
2544
- trendline.setName("Linear");
2544
+ trendline.name = "Linear";
2545
2545
  //Displaying the equation on chart
2546
- trendline.setDisplayEquation(true);
2546
+ trendline.displayEquation = true;
2547
2547
  //Displaying the R-Squared value on chart
2548
- trendline.setDisplayRSquared(true);
2548
+ trendline.displayRSquared = true;
2549
2549
  //Saving the Excel file
2550
2550
  workbook.save("output/ChartsTrendline.xls");
2551
2551
  }
@@ -2555,9 +2555,9 @@ function sampleCommentCollection() {
2555
2555
  const { Workbook } = require("aspose.cells.node");
2556
2556
 
2557
2557
  var excel = new Workbook();
2558
- var index = excel.getWorksheets().get(0).getCheckBoxes().add(15, 15, 20, 100);
2559
- var checkBox = excel.getWorksheets().get(0).getCheckBoxes().get(index);
2560
- checkBox.setText("Check Box 1");
2558
+ var index = excel.worksheets.get(0).getCheckBoxes().add(15, 15, 20, 100);
2559
+ var checkBox = excel.worksheets.get(0).getCheckBoxes().get(index);
2560
+ checkBox.text = "Check Box 1";
2561
2561
  }
2562
2562
  sampleCommentCollection();
2563
2563
 
@@ -2567,13 +2567,13 @@ function sampleAutoFilter() {
2567
2567
  //Instantiating a Workbook object
2568
2568
  var workbook = new Workbook("input/AutoFilter.xlsx");
2569
2569
  //Accessing the first worksheet in the Excel file
2570
- var worksheet = workbook.getWorksheets().get(0);
2570
+ var worksheet = workbook.worksheets.get(0);
2571
2571
  //Creating AutoFilter by giving the cells range of the heading row
2572
- worksheet.getAutoFilter().setRange("A1:C1");
2572
+ worksheet.autoFilter.range = "A1:C1";
2573
2573
  //Filtering columns with specified values
2574
- worksheet.getAutoFilter().filter(2, "present");
2574
+ worksheet.autoFilter.filter(2, "present");
2575
2575
  // Refreshing auto filters to hide or unhide the rows.
2576
- worksheet.getAutoFilter().refresh();
2576
+ worksheet.autoFilter.refresh();
2577
2577
  //Saving the modified Excel file.
2578
2578
  workbook.save("output/AutoFilter.xlsx");
2579
2579
  }
@@ -2585,7 +2585,7 @@ function samplePropertiesDocumentProperty() {
2585
2585
  //Instantiate a Workbook object
2586
2586
  var workbook = new Workbook("input/CustomProperties.xlsx");
2587
2587
  //Retrieve a list of all custom document properties of the Excel file
2588
- var customProperties = workbook.getWorksheets().getCustomDocumentProperties();
2588
+ var customProperties = workbook.worksheets.customDocumentProperties;
2589
2589
  //Accessng a custom document property by using the property index
2590
2590
  var customProperty1 = customProperties.get(3);
2591
2591
  //Accessng a custom document property by using the property name
@@ -2597,7 +2597,7 @@ function sampleChartsChartCollection() {
2597
2597
  const { Workbook } = require("aspose.cells.node");
2598
2598
 
2599
2599
  var workbook = new Workbook();
2600
- var charts = workbook.getWorksheets().get(0).getCharts();
2600
+ var charts = workbook.worksheets.get(0).charts;
2601
2601
  }
2602
2602
  sampleChartsChartCollection();
2603
2603
 
@@ -2607,36 +2607,36 @@ function sampleChartsChartPointCollection() {
2607
2607
  //Instantiating a Workbook object
2608
2608
  var workbook = new Workbook();
2609
2609
  //Obtaining the reference of the first worksheet
2610
- var worksheet = workbook.getWorksheets().get(0);
2610
+ var worksheet = workbook.worksheets.get(0);
2611
2611
  //Adding a sample value to "A1" cell
2612
- worksheet.getCells().get("A1").putValue(50);
2612
+ worksheet.cells.get("A1").putValue(50);
2613
2613
  //Adding a sample value to "A2" cell
2614
- worksheet.getCells().get("A2").putValue(100);
2614
+ worksheet.cells.get("A2").putValue(100);
2615
2615
  //Adding a sample value to "A3" cell
2616
- worksheet.getCells().get("A3").putValue(150);
2616
+ worksheet.cells.get("A3").putValue(150);
2617
2617
  //Adding a sample value to "B1" cell
2618
- worksheet.getCells().get("B1").putValue(60);
2618
+ worksheet.cells.get("B1").putValue(60);
2619
2619
  //Adding a sample value to "B2" cell
2620
- worksheet.getCells().get("B2").putValue(32);
2620
+ worksheet.cells.get("B2").putValue(32);
2621
2621
  //Adding a sample value to "B3" cell
2622
- worksheet.getCells().get("B3").putValue(50);
2622
+ worksheet.cells.get("B3").putValue(50);
2623
2623
  //Adding a chart to the worksheet
2624
- var chartIndex = worksheet.getCharts().add(ChartType.PieExploded, 5, 0, 25, 10);
2624
+ var chartIndex = worksheet.charts.add(ChartType.PieExploded, 5, 0, 25, 10);
2625
2625
  //Accessing the instance of the newly added chart
2626
- var chart = worksheet.getCharts().get(chartIndex);
2626
+ var chart = worksheet.charts.get(chartIndex);
2627
2627
  //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
2628
- chart.getNSeries().add("A1:B3", true);
2628
+ chart.nSeries.add("A1:B3", true);
2629
2629
  //Show Data Labels
2630
- chart.getNSeries().get(0).getDataLabels().setShowValue(true);
2631
- var points = chart.getNSeries().get(0).getPoints();
2630
+ chart.nSeries.get(0).dataLabels.showValue = true;
2631
+ var points = chart.nSeries.get(0).points;
2632
2632
  var red = Color.Red;
2633
- for (var i = 0; i < points.getCount(); i++) {
2633
+ for (var i = 0; i < points.count; i++) {
2634
2634
  //Get Data Point
2635
2635
  var point = points.get(i);
2636
2636
  //Set Pir Explosion
2637
- point.setExplosion(15);
2637
+ point.explosion = 15;
2638
2638
  //Set Border Color
2639
- point.getBorder().setColor(red);
2639
+ point.border.color = red;
2640
2640
  }
2641
2641
 
2642
2642
  //Saving the Excel file