You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+46-2
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,17 @@
14
14
15
15
- As part of the new version 3.0.0+, there is support for _XLSX_. The drawback is that the library is 200+ KB.
16
16
17
-
- If you only need _XLS_ or _CSV_, use _2.X.X_ versions.
18
-
19
17
- Check My Blog Page for Testing :
20
18
[JavaScript export to Excel](http://jordiburgos.com/post/2013/javascript-export-to-excel.html)
21
19
22
20
[ExcellentExport.js update: JavaScript export to Excel and CSV](http://jordiburgos.com/post/2017/excellentexport-javascript-export-to-excel-csv.html)
23
21
24
22
# Revision history:
25
23
24
+
### 3.9.0
25
+
26
+
* Cell types and formats!!! Now you can define the cell type and format. For example, you can define a cell as a date or a number. You can also define the format of the cell. For example, you can define a cell as a date with the format "dd/mm/yyyy" or a number with the format "#,##0.00".
27
+
26
28
### 3.8.1
27
29
28
30
* Activate XLSX compression by default. The example of index.bigtable.html went from 18Mb to 3Mb.
@@ -241,6 +243,7 @@
241
243
fixValue: function(value, row, column) {return fixedValue} // Function to fix values, receiving value, row num, column num
242
244
fixArray: function(array) {return array} // Function to manipulate the whole data array
243
245
rtl: Use Right-to-left characters, boolean (optional)
246
+
formats: [...] // Array of formats for each column. See formats below.
244
247
...
245
248
},
246
249
{
@@ -259,6 +262,47 @@ It transforms BR to line breaks and then strips all the HTML tags.
259
262
return strippedString;
260
263
}
261
264
265
+
## Formats
266
+
267
+
You can specify an array with the formats for a specific cell range (i.e. A1:A100, A1:D100, A1:H1, etc).
268
+
269
+
Each element in the format array consists on:
270
+
271
+
```json
272
+
{
273
+
"range": "A1:A100", // Range of cells to apply the format, mandatory
274
+
"format": {
275
+
"type": "<cell_type>", // Type of format, mandatory
276
+
"pattern": "<pattern>"// Pattern, optional
277
+
}
278
+
}
279
+
```
280
+
281
+
`format` can be used from one of the predefined types if you use TypeScript
282
+
283
+
```typescript
284
+
{
285
+
"range": "A1:A100",
286
+
"format": PredefinedFormat.INTEGER
287
+
}
288
+
```
289
+
290
+
`cell_type` can be one of the followint:
291
+
292
+
's': String
293
+
'n': Number
294
+
'd': Date
295
+
'b': Boolean
296
+
297
+
`pattern` is a string with the format pattern used in Excel. For example:
0 commit comments