aspose.cells.node 24.11.0 → 25.1.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.
package/README.md CHANGED
@@ -35,6 +35,17 @@ workbook.getWorksheets().get(0).getCells().get("A1").putValue("Hello World");
35
35
  workbook.save("hello-world.xlsx");
36
36
  ```
37
37
 
38
+ #### Use **import** of ES6
39
+ ``` js
40
+ import AsposeCells from "aspose.cells.node";
41
+ const { Workbook, FileFormatType } = AsposeCells;
42
+
43
+ var workbook = new Workbook(FileFormatType.Xlsx);
44
+ workbook.getWorksheets().get(0).getCells().get("A1").putValue("Hello World");
45
+ workbook.save("hello-world.xlsx");
46
+ ```
47
+ **Note**: Please save the above code as **example.mjs** file and run it using **`node example.mjs`**.
48
+
38
49
  ### Convert Excel XLSX File to PDF
39
50
  ``` js
40
51
  const { Workbook } = require("aspose.cells.node");
@@ -74,4 +85,105 @@ worksheet.getPictures().add(5, 5, "image.gif");
74
85
  workbook.save("picture-example.xls", SaveFormat.Excel97To2003);
75
86
  ```
76
87
 
88
+ ### Calculate Custom Functions
89
+ ```js
90
+ const { Workbook, CalculationOptions, AbstractCalculationEngine } = require("aspose.cells.node");
91
+
92
+ class CustomFunction extends AbstractCalculationEngine {
93
+ constructor() {
94
+ super();
95
+ }
96
+
97
+ calculate(data) {
98
+ var functionName = data.getFunctionName();
99
+ if (functionName == "myarrayfunch") {
100
+ var r = new Array();
101
+ r[0] = [1.0, 2.0, 3.0, 4.0, 5.0];
102
+ data.setCalculatedValue(r);
103
+ return;
104
+ }
105
+ else if (functionName == "myarrayfuncv") {
106
+ var r = new Array();
107
+ r[0] = [1.0];
108
+ r[1] = [2.0];
109
+ r[2] = [3.0];
110
+ r[3] = [4.0];
111
+ r[4] = [5.0];
112
+ data.setCalculatedValue(r);
113
+ return;
114
+ }
115
+ else if (functionName == "myrange") {
116
+ data.setCalculatedValue(data.getWorksheet().getCells().createRange("A1", "F1"));
117
+ return;
118
+ }
119
+ else if (functionName == "UDFTest") {
120
+ data.setCalculatedValue(data.getParamValue(0));
121
+ }
122
+ }
123
+ };
124
+
125
+ var wb = new Workbook();
126
+ var sheet = wb.getWorksheets().get(0);
127
+ var cells = sheet.getCells();
128
+
129
+ // Create table with data
130
+ var range = cells.createRange("B3:D5");
131
+ var arr = new Array();
132
+ arr[0] = ["AccountNum", "UDF", "Normal"];
133
+ arr[1] = ["Row01", "", ""];
134
+ arr[2] = ["Row02", "", ""];
135
+
136
+ range.setValue(arr);
137
+ var firstRow = range.getFirstRow();
138
+ var firstColumn = range.getFirstColumn();
139
+ var endRow = firstRow + range.getRowCount();
140
+ var endColumn = firstColumn + range.getColumnCount();
141
+ sheet.getListObjects().add(firstRow, firstColumn, endRow, endColumn, true);
142
+
143
+ // Populate formulas
144
+ cells.get("C5").setFormula("=UDFTest([@AccountNum])");
145
+ cells.get("C4").setFormula("=UDFTest([@AccountNum])"); // UDF formula
146
+
147
+ cells.get("D5").setFormula("=[@AccountNum]");
148
+ cells.get("D4").setFormula("=[@AccountNum]"); // Built-in formula comparison
149
+
150
+ // Calculate workbook
151
+ var opt = new CalculationOptions();
152
+ var customFunction = new CustomFunction();
153
+ opt.setCustomEngine(customFunction);
154
+ wb.calculateFormula(opt);
155
+
156
+ console.log("Row01" == cells.get("C4").getStringValue());
157
+ console.log("Row02" == cells.get("C5").getStringValue());
158
+ console.log("Row01" == cells.get("D4").getStringValue());
159
+ console.log("Row02" == cells.get("D5").getStringValue());
160
+
161
+
162
+ var workbook = new Workbook();
163
+ var worksheet = workbook.getWorksheets().get(0);
164
+
165
+ // Get the cells collection in the sheet
166
+ var cells = worksheet.getCells();
167
+ cells.get("A1").setArrayFormula("=myarrayfunch()", 1, 5);
168
+ cells.get("A2").setArrayFormula("=myarrayfuncv()", 5, 1);
169
+ cells.get("A7").setArrayFormula("=A1:E1*100", 1, 5);
170
+ cells.get("A8").setFormula("=sum(myrange())", 100);
171
+
172
+ var cf = new CustomFunction();
173
+ var cOpt = new CalculationOptions();
174
+ cOpt.setCustomEngine(cf);
175
+ workbook.calculateFormula(cOpt);
176
+ for (var i = 0; i < 5; i++) {
177
+ console.log(i + 1.0 == cells.get(0, i).getDoubleValue());
178
+ }
179
+ for (var i = 1; i < 6; i++) {
180
+ console.log(i == cells.get(i, 0).getDoubleValue());
181
+ }
182
+ for (var i = 0; i < 5; i++) {
183
+ console.log(i * 100 + 100.0 == cells.get(6, i).getDoubleValue());
184
+ }
185
+ console.log(cells.get("A8").getDoubleValue() == 15);
186
+ console.log("done");
187
+ ```
188
+
77
189
  [Product Page](https://products.aspose.com/cells/nodejs-cpp) | [Product Documentation](https://docs.aspose.com/cells/nodejs-cpp/) | [Blog](https://blog.aspose.com/categories/aspose.cells-product-family/) |[API Reference](https://reference.aspose.com/cells/nodejs-cpp) | [Free Support](https://forum.aspose.com/c/cells) | [Temporary License](https://purchase.aspose.com/temporary-license)
package/aspose.cells.js CHANGED
@@ -1,19 +1,11 @@
1
- // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
1
+ // Copyright (c) 2001-2025 Aspose Pty Ltd. All Rights Reserved.
2
2
  // Powered by Aspose.Cells.
3
3
  'use strict'
4
4
 
5
5
  switch (process.platform) {
6
6
  case "linux":
7
7
  if (process.arch === "x64") {
8
- let regex = /^(\d+)\./;
9
- let match = process.versions.openssl.match(regex);
10
- let major = match ? match[1] : null;
11
- if (major == '1') {
12
- module.exports = require("aspose.cells.node.linux.legacy.x64");
13
- }
14
- else {
15
- module.exports = require("aspose.cells.node.linux.x64");
16
- }
8
+ module.exports = require("aspose.cells.node.linux.x64");
17
9
  }
18
10
  break;
19
11
  case "win32":
@@ -57,6 +49,14 @@ exports.AutoFillType = {
57
49
  Values : 4,
58
50
  };
59
51
 
52
+ exports.FilterCategory = {
53
+ None : 0,
54
+ Label : 1,
55
+ NumberValue : 2,
56
+ Date : 3,
57
+ Top10 : 4,
58
+ };
59
+
60
60
  exports.AutoFitMergedCellsType = {
61
61
  None : 0,
62
62
  FirstLine : 1,
@@ -1441,36 +1441,56 @@ exports.PivotFilterType = {
1441
1441
  DateBetween : 15,
1442
1442
  DateEqual : 16,
1443
1443
  DateNewerThan : 17,
1444
+ DateAfter : 17,
1444
1445
  DateNewerThanOrEqual : 18,
1446
+ DateAfterOrEqual : 18,
1445
1447
  DateNotBetween : 19,
1446
1448
  DateNotEqual : 20,
1447
1449
  DateOlderThan : 21,
1450
+ DateBefore : 21,
1448
1451
  DateOlderThanOrEqual : 22,
1452
+ DateBeforeOrEqual : 22,
1449
1453
  LastMonth : 23,
1450
1454
  LastQuarter : 24,
1451
1455
  LastWeek : 25,
1452
1456
  LastYear : 26,
1453
1457
  M1 : 27,
1458
+ January : 27,
1454
1459
  M2 : 28,
1460
+ February : 28,
1455
1461
  M3 : 29,
1462
+ March : 29,
1456
1463
  M4 : 30,
1464
+ April : 30,
1457
1465
  M5 : 31,
1466
+ May : 31,
1458
1467
  M6 : 32,
1468
+ June : 32,
1459
1469
  M7 : 33,
1470
+ July : 33,
1460
1471
  M8 : 34,
1472
+ August : 34,
1461
1473
  M9 : 35,
1474
+ September : 35,
1462
1475
  M10 : 36,
1476
+ October : 36,
1463
1477
  M11 : 37,
1478
+ November : 37,
1464
1479
  M12 : 38,
1480
+ December : 38,
1465
1481
  NextMonth : 39,
1466
1482
  NextQuarter : 40,
1467
1483
  NextWeek : 41,
1468
1484
  NextYear : 42,
1469
1485
  Percent : 43,
1470
1486
  Q1 : 44,
1487
+ Quarter1 : 44,
1471
1488
  Q2 : 45,
1489
+ Quarter2 : 45,
1472
1490
  Q3 : 46,
1491
+ Quarter3 : 46,
1473
1492
  Q4 : 47,
1493
+ Quarter4 : 47,
1474
1494
  Sum : 48,
1475
1495
  ThisMonth : 49,
1476
1496
  ThisQuarter : 50,
@@ -1489,6 +1509,7 @@ exports.PivotFilterType = {
1489
1509
  ValueNotEqual : 63,
1490
1510
  YearToDate : 64,
1491
1511
  Yesterday : 65,
1512
+ None : 255,
1492
1513
  };
1493
1514
 
1494
1515
  exports.PivotMissingItemLimitType = {
@@ -2903,6 +2924,10 @@ exports.ExceptionType = {
2903
2924
  UndisclosedInformation : 22,
2904
2925
  FileCorrupted : 23,
2905
2926
  Internal : 24,
2927
+ DefinedName : 25,
2928
+ Font : 26,
2929
+ AutoFilter : 27,
2930
+ FontSubstitution : 28,
2906
2931
  };
2907
2932
 
2908
2933
  exports.FileFormatType = {
@@ -3051,6 +3076,8 @@ exports.FilterOperatorType = {
3051
3076
  EndsWith : 8,
3052
3077
  Contains : 9,
3053
3078
  NotContains : 10,
3079
+ NotBeginsWith : 11,
3080
+ NotEndsWith : 12,
3054
3081
  };
3055
3082
 
3056
3083
  exports.FontUnderlineType = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aspose.cells.node",
3
- "version": "24.11.0",
3
+ "version": "25.1.0",
4
4
  "description": "Aspose.Cells for Node.js via C++ is a high-performance and powerful library for manipulating and converting Excel (XLS, XLSX, XLSB), ODS, CSV, and HTML files, offering a comprehensive set of features for creating, editing, converting, and rendering spreadsheets within Node.js applications.",
5
5
  "main": "aspose.cells.js",
6
6
  "types": "types.d.ts",
@@ -35,10 +35,9 @@
35
35
  "license": "Commercial",
36
36
  "homepage": "https://www.aspose.com",
37
37
  "optionalDependencies": {
38
- "aspose.cells.node.win32.x64": "~24.11.0",
39
- "aspose.cells.node.linux.x64": "~24.11.0",
40
- "aspose.cells.node.linux.legacy.x64": "~24.11.0",
41
- "aspose.cells.node.darwin.x64": "~24.11.0",
42
- "aspose.cells.node.darwin.arm64": "~24.11.0"
38
+ "aspose.cells.node.win32.x64": "~25.1.0",
39
+ "aspose.cells.node.linux.x64": "~25.1.0",
40
+ "aspose.cells.node.darwin.x64": "~25.1.0",
41
+ "aspose.cells.node.darwin.arm64": "~25.1.0"
43
42
  }
44
43
  }