excellentexport 3.9.10 → 3.9.11
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/.github/FUNDING.yml +1 -1
- package/.github/dependabot.yml +7 -7
- package/LICENSE.txt +21 -21
- package/README.md +4 -0
- package/bower.json +32 -32
- package/dist/excellentexport.d.ts +45 -45
- package/dist/excellentexport.js +2 -2
- package/index.bigtable.html +55 -55
- package/index.filters.html +63 -63
- package/index.html +127 -127
- package/index.noanchor.html +31 -31
- package/index.rtl.html +68 -68
- package/jest.config.ts +203 -203
- package/package.json +46 -46
- package/src/excellentexport.ts +2 -2
- package/src/utils.ts +144 -144
- package/test/convert-filters.test.ts +70 -70
- package/test/convert-table.test.ts +71 -71
- package/test/fixdata.test.ts +74 -74
- package/test/utils.test.ts +29 -29
- package/test/utils_fixdata.test.ts +24 -24
- package/test/utils_removeColumns.test.ts +98 -98
- package/tsconfig.json +17 -17
package/index.bigtable.html
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<meta charset="utf-8">
|
|
4
|
-
<title>Export to excel test</title>
|
|
5
|
-
<script src="dist/excellentexport.js"></script>
|
|
6
|
-
<style>
|
|
7
|
-
table, tr, td {
|
|
8
|
-
border: 1px black solid;
|
|
9
|
-
}
|
|
10
|
-
</style>
|
|
11
|
-
<script>
|
|
12
|
-
function action(format) {
|
|
13
|
-
return ExcellentExport.convert({
|
|
14
|
-
anchor: 'bigdata-' + format,
|
|
15
|
-
filename: 'big_table.' + format,
|
|
16
|
-
format: format
|
|
17
|
-
}, [{
|
|
18
|
-
name: 'Big Table',
|
|
19
|
-
from: {
|
|
20
|
-
table: 'bigtable'
|
|
21
|
-
}
|
|
22
|
-
}]);
|
|
23
|
-
}
|
|
24
|
-
</script>
|
|
25
|
-
</head>
|
|
26
|
-
<body>
|
|
27
|
-
<h1>ExcellentExport.js</h1>
|
|
28
|
-
|
|
29
|
-
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
30
|
-
|
|
31
|
-
<h3>Big Table Test page</h3>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<a id="bigdata-xlsx" download="bigdata.xlsx" href="#" onclick="return action('xlsx')">Export to XLSX very big table</a><br/>
|
|
35
|
-
<a id="bigdata-xls" download="bigdata.xls" href="#" onclick="return action('xls')">Export to XLS very big table</a><br/>
|
|
36
|
-
<a id="bigdata-csv" download="bigdata.csv" href="#" onclick="return action('csv')">Export to CSV very big table</a>
|
|
37
|
-
<table id="bigtable">
|
|
38
|
-
<br/>
|
|
39
|
-
</table>
|
|
40
|
-
<script>
|
|
41
|
-
var table = document.getElementById('bigtable');
|
|
42
|
-
var n = 5000;
|
|
43
|
-
var cols = 50;
|
|
44
|
-
var i, j;
|
|
45
|
-
|
|
46
|
-
for (i=0; i < n; i=i+1) {
|
|
47
|
-
var row = table.insertRow(0);
|
|
48
|
-
for (j=0; j < cols; j=j+1) {
|
|
49
|
-
var cell = row.insertCell(0);
|
|
50
|
-
cell.innerHTML = "Test " + Math.random();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
</body>
|
|
55
|
-
</html>
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<title>Export to excel test</title>
|
|
5
|
+
<script src="dist/excellentexport.js"></script>
|
|
6
|
+
<style>
|
|
7
|
+
table, tr, td {
|
|
8
|
+
border: 1px black solid;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
<script>
|
|
12
|
+
function action(format) {
|
|
13
|
+
return ExcellentExport.convert({
|
|
14
|
+
anchor: 'bigdata-' + format,
|
|
15
|
+
filename: 'big_table.' + format,
|
|
16
|
+
format: format
|
|
17
|
+
}, [{
|
|
18
|
+
name: 'Big Table',
|
|
19
|
+
from: {
|
|
20
|
+
table: 'bigtable'
|
|
21
|
+
}
|
|
22
|
+
}]);
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<h1>ExcellentExport.js</h1>
|
|
28
|
+
|
|
29
|
+
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
30
|
+
|
|
31
|
+
<h3>Big Table Test page</h3>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<a id="bigdata-xlsx" download="bigdata.xlsx" href="#" onclick="return action('xlsx')">Export to XLSX very big table</a><br/>
|
|
35
|
+
<a id="bigdata-xls" download="bigdata.xls" href="#" onclick="return action('xls')">Export to XLS very big table</a><br/>
|
|
36
|
+
<a id="bigdata-csv" download="bigdata.csv" href="#" onclick="return action('csv')">Export to CSV very big table</a>
|
|
37
|
+
<table id="bigtable">
|
|
38
|
+
<br/>
|
|
39
|
+
</table>
|
|
40
|
+
<script>
|
|
41
|
+
var table = document.getElementById('bigtable');
|
|
42
|
+
var n = 5000;
|
|
43
|
+
var cols = 50;
|
|
44
|
+
var i, j;
|
|
45
|
+
|
|
46
|
+
for (i=0; i < n; i=i+1) {
|
|
47
|
+
var row = table.insertRow(0);
|
|
48
|
+
for (j=0; j < cols; j=j+1) {
|
|
49
|
+
var cell = row.insertCell(0);
|
|
50
|
+
cell.innerHTML = "Test " + Math.random();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|
package/index.filters.html
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<meta charset="utf-8">
|
|
4
|
-
<title>Export to excel test</title>
|
|
5
|
-
<script src="dist/excellentexport.js"></script>
|
|
6
|
-
<style>
|
|
7
|
-
table, tr, td {
|
|
8
|
-
border: 1px black solid;
|
|
9
|
-
}
|
|
10
|
-
</style>
|
|
11
|
-
<script>
|
|
12
|
-
function newApi(format) {
|
|
13
|
-
return ExcellentExport.convert({
|
|
14
|
-
anchor: 'anchorNewApi-' + format,
|
|
15
|
-
filename: 'data_123.' + format,
|
|
16
|
-
format: format
|
|
17
|
-
}, [{
|
|
18
|
-
name: 'Sheet Name Here 1',
|
|
19
|
-
from: {
|
|
20
|
-
table: 'datatable'
|
|
21
|
-
},
|
|
22
|
-
fixValue: (value, row, col) => {
|
|
23
|
-
let v = value.replace(/<br>/gi, "\n");
|
|
24
|
-
let strippedString = v.replace(/(<([^>]+)>)/gi, "");
|
|
25
|
-
return strippedString;
|
|
26
|
-
}
|
|
27
|
-
}]);
|
|
28
|
-
}
|
|
29
|
-
</script>
|
|
30
|
-
</head>
|
|
31
|
-
<body>
|
|
32
|
-
<h1>ExcellentExport.js</h1>
|
|
33
|
-
|
|
34
|
-
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
35
|
-
|
|
36
|
-
<h3>Test page</h3>
|
|
37
|
-
|
|
38
|
-
Test table:
|
|
39
|
-
<table id="datatable">
|
|
40
|
-
<tr>
|
|
41
|
-
<th>Column 1</th>
|
|
42
|
-
<th>Column 2</th>
|
|
43
|
-
<th>Column 3</th>
|
|
44
|
-
<th>Column 4</th>
|
|
45
|
-
</tr>
|
|
46
|
-
<tr>
|
|
47
|
-
<td>hello<br>world</td>
|
|
48
|
-
<td><span>text in span</span></td>
|
|
49
|
-
<td>abc</td>
|
|
50
|
-
<td>def</td>
|
|
51
|
-
</tr>
|
|
52
|
-
</table>
|
|
53
|
-
|
|
54
|
-
<br/>
|
|
55
|
-
|
|
56
|
-
<a href="#" id="anchorNewApi-xlsx" onclick="return newApi('xlsx');">Export to XLSX from array</a>
|
|
57
|
-
<br>
|
|
58
|
-
<a href="#" id="anchorNewApi-xls" onclick="return newApi('xls');">Export to XLS from array</a>
|
|
59
|
-
<br>
|
|
60
|
-
<a href="#" id="anchorNewApi-csv" onclick="return newApi('csv');">Export to CSV from array</a>
|
|
61
|
-
|
|
62
|
-
</body>
|
|
63
|
-
</html>
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<title>Export to excel test</title>
|
|
5
|
+
<script src="dist/excellentexport.js"></script>
|
|
6
|
+
<style>
|
|
7
|
+
table, tr, td {
|
|
8
|
+
border: 1px black solid;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
<script>
|
|
12
|
+
function newApi(format) {
|
|
13
|
+
return ExcellentExport.convert({
|
|
14
|
+
anchor: 'anchorNewApi-' + format,
|
|
15
|
+
filename: 'data_123.' + format,
|
|
16
|
+
format: format
|
|
17
|
+
}, [{
|
|
18
|
+
name: 'Sheet Name Here 1',
|
|
19
|
+
from: {
|
|
20
|
+
table: 'datatable'
|
|
21
|
+
},
|
|
22
|
+
fixValue: (value, row, col) => {
|
|
23
|
+
let v = value.replace(/<br>/gi, "\n");
|
|
24
|
+
let strippedString = v.replace(/(<([^>]+)>)/gi, "");
|
|
25
|
+
return strippedString;
|
|
26
|
+
}
|
|
27
|
+
}]);
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
<h1>ExcellentExport.js</h1>
|
|
33
|
+
|
|
34
|
+
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
35
|
+
|
|
36
|
+
<h3>Test page</h3>
|
|
37
|
+
|
|
38
|
+
Test table:
|
|
39
|
+
<table id="datatable">
|
|
40
|
+
<tr>
|
|
41
|
+
<th>Column 1</th>
|
|
42
|
+
<th>Column 2</th>
|
|
43
|
+
<th>Column 3</th>
|
|
44
|
+
<th>Column 4</th>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td>hello<br>world</td>
|
|
48
|
+
<td><span>text in span</span></td>
|
|
49
|
+
<td>abc</td>
|
|
50
|
+
<td>def</td>
|
|
51
|
+
</tr>
|
|
52
|
+
</table>
|
|
53
|
+
|
|
54
|
+
<br/>
|
|
55
|
+
|
|
56
|
+
<a href="#" id="anchorNewApi-xlsx" onclick="return newApi('xlsx');">Export to XLSX from array</a>
|
|
57
|
+
<br>
|
|
58
|
+
<a href="#" id="anchorNewApi-xls" onclick="return newApi('xls');">Export to XLS from array</a>
|
|
59
|
+
<br>
|
|
60
|
+
<a href="#" id="anchorNewApi-csv" onclick="return newApi('csv');">Export to CSV from array</a>
|
|
61
|
+
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
package/index.html
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<meta charset="utf-8">
|
|
4
|
-
<title>Export to excel test</title>
|
|
5
|
-
<script src="dist/excellentexport.js"></script>
|
|
6
|
-
<style>
|
|
7
|
-
table, tr, td {
|
|
8
|
-
border: 1px black solid;
|
|
9
|
-
}
|
|
10
|
-
</style>
|
|
11
|
-
<script>
|
|
12
|
-
function newApi(format) {
|
|
13
|
-
return ExcellentExport.convert({
|
|
14
|
-
anchor: 'anchorNewApi-' + format,
|
|
15
|
-
filename: 'data_123.' + format,
|
|
16
|
-
format: format
|
|
17
|
-
}, [{
|
|
18
|
-
name: 'Sheet Name Here 1',
|
|
19
|
-
from: {
|
|
20
|
-
table: 'datatable'
|
|
21
|
-
}
|
|
22
|
-
}]);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function newApiArray(format) {
|
|
26
|
-
return ExcellentExport.convert({
|
|
27
|
-
anchor: 'anchorNewApi-' + format + '-array',
|
|
28
|
-
filename: 'data_123.array',
|
|
29
|
-
format: format
|
|
30
|
-
}, [{
|
|
31
|
-
name: 'Sheet Name Here 1',
|
|
32
|
-
from: {
|
|
33
|
-
array: [['line 1', 1234 , 'CN 你好'],
|
|
34
|
-
['line 2', 1234.56 , 'JP こんにちは']
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
}]);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function exportSome() {
|
|
41
|
-
return ExcellentExport.convert({
|
|
42
|
-
anchor: "anchorNewApi-xlsx-some",
|
|
43
|
-
filename: "somedata",
|
|
44
|
-
format: "xlsx"
|
|
45
|
-
}, [{
|
|
46
|
-
name: 'Sheet number 1',
|
|
47
|
-
from: {
|
|
48
|
-
table: 'datatable'
|
|
49
|
-
},
|
|
50
|
-
filterRowFn: function(row) {
|
|
51
|
-
if (row[1] == 200) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
},
|
|
56
|
-
removeColumns: [1],
|
|
57
|
-
|
|
58
|
-
}])
|
|
59
|
-
}
|
|
60
|
-
</script>
|
|
61
|
-
</head>
|
|
62
|
-
<body>
|
|
63
|
-
<h1>ExcellentExport.js</h1>
|
|
64
|
-
|
|
65
|
-
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
66
|
-
|
|
67
|
-
<h3>Test page</h3>
|
|
68
|
-
|
|
69
|
-
Test table:
|
|
70
|
-
<table id="datatable">
|
|
71
|
-
<tr>
|
|
72
|
-
<th>Column 1</th>
|
|
73
|
-
<th>Column "cool" 2</th>
|
|
74
|
-
<th>Column 3</th>
|
|
75
|
-
<th>Column 4</th>
|
|
76
|
-
</tr>
|
|
77
|
-
<tr>
|
|
78
|
-
<td>100,111</td>
|
|
79
|
-
<td>200</td>
|
|
80
|
-
<td>030</td>
|
|
81
|
-
<td>áéíóú</td>
|
|
82
|
-
</tr>
|
|
83
|
-
<tr>
|
|
84
|
-
<td>400</td>
|
|
85
|
-
<td>500</td>
|
|
86
|
-
<td>Chinese chars: 解决导出csv中文乱码问题</td>
|
|
87
|
-
<td>àèìòù</td>
|
|
88
|
-
</tr>
|
|
89
|
-
<tr>
|
|
90
|
-
<td>Text</td>
|
|
91
|
-
<td>More text</td>
|
|
92
|
-
<td>Text with
|
|
93
|
-
new line</td>
|
|
94
|
-
<td>ç ñ ÄËÏÖÜ äëïöü</td>
|
|
95
|
-
</tr>
|
|
96
|
-
</table>
|
|
97
|
-
|
|
98
|
-
<br/>
|
|
99
|
-
|
|
100
|
-
<a download="somedata.xls" href="#" onclick="return ExcellentExport.excel(this, 'datatable', 'Sheet Name Here');">Export to Excel</a>
|
|
101
|
-
<br/>
|
|
102
|
-
|
|
103
|
-
<a download="somedata.csv" href="#" onclick="return ExcellentExport.csv(this, 'datatable');">Export to CSV - UTF8</a>
|
|
104
|
-
<br/>
|
|
105
|
-
<a download="somedata.csv" href="#" onclick="return ExcellentExport.csv(this, 'datatable', ';');">Export to CSV - Using semicolon ";" separator - UTF8</a>
|
|
106
|
-
<br/>
|
|
107
|
-
<h1>NEW API!</h1>
|
|
108
|
-
<a download="data_123.xls" href="#" id="anchorNewApi-xls" onclick="return newApi('xls');">Export to Excel: XLS format</a>
|
|
109
|
-
<br/>
|
|
110
|
-
<a download="data_123.xlsx" href="#" id="anchorNewApi-xlsx" onclick="return newApi('xlsx');">Export to Excel: XLSX format</a>
|
|
111
|
-
<br/>
|
|
112
|
-
<a download="data_123.csv" href="#" id="anchorNewApi-csv" onclick="return newApi('csv');">Export to CSV</a>
|
|
113
|
-
<br>
|
|
114
|
-
<a href="#" id="anchorNewApi-xlsx-some" onclick="return exportSome();">Export to Excel: XLSX filtering columns and rows</a>
|
|
115
|
-
<br/>
|
|
116
|
-
<br/>
|
|
117
|
-
|
|
118
|
-
<h1>NEW API from Arrays!</h1>
|
|
119
|
-
|
|
120
|
-
<a href="#" id="anchorNewApi-xlsx-array" onclick="return newApiArray('xlsx');">Export to XLSX from array</a>
|
|
121
|
-
<br>
|
|
122
|
-
<a href="#" id="anchorNewApi-xls-array" onclick="return newApiArray('xls');">Export to XLS from array</a>
|
|
123
|
-
<br>
|
|
124
|
-
<a href="#" id="anchorNewApi-csv-array" onclick="return newApiArray('csv');">Export to CSV from array</a>
|
|
125
|
-
|
|
126
|
-
</body>
|
|
127
|
-
</html>
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<title>Export to excel test</title>
|
|
5
|
+
<script src="dist/excellentexport.js"></script>
|
|
6
|
+
<style>
|
|
7
|
+
table, tr, td {
|
|
8
|
+
border: 1px black solid;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
<script>
|
|
12
|
+
function newApi(format) {
|
|
13
|
+
return ExcellentExport.convert({
|
|
14
|
+
anchor: 'anchorNewApi-' + format,
|
|
15
|
+
filename: 'data_123.' + format,
|
|
16
|
+
format: format
|
|
17
|
+
}, [{
|
|
18
|
+
name: 'Sheet Name Here 1',
|
|
19
|
+
from: {
|
|
20
|
+
table: 'datatable'
|
|
21
|
+
}
|
|
22
|
+
}]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function newApiArray(format) {
|
|
26
|
+
return ExcellentExport.convert({
|
|
27
|
+
anchor: 'anchorNewApi-' + format + '-array',
|
|
28
|
+
filename: 'data_123.array',
|
|
29
|
+
format: format
|
|
30
|
+
}, [{
|
|
31
|
+
name: 'Sheet Name Here 1',
|
|
32
|
+
from: {
|
|
33
|
+
array: [['line 1', 1234 , 'CN 你好'],
|
|
34
|
+
['line 2', 1234.56 , 'JP こんにちは']
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function exportSome() {
|
|
41
|
+
return ExcellentExport.convert({
|
|
42
|
+
anchor: "anchorNewApi-xlsx-some",
|
|
43
|
+
filename: "somedata",
|
|
44
|
+
format: "xlsx"
|
|
45
|
+
}, [{
|
|
46
|
+
name: 'Sheet number 1',
|
|
47
|
+
from: {
|
|
48
|
+
table: 'datatable'
|
|
49
|
+
},
|
|
50
|
+
filterRowFn: function(row) {
|
|
51
|
+
if (row[1] == 200) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
},
|
|
56
|
+
removeColumns: [1],
|
|
57
|
+
|
|
58
|
+
}])
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<h1>ExcellentExport.js</h1>
|
|
64
|
+
|
|
65
|
+
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
66
|
+
|
|
67
|
+
<h3>Test page</h3>
|
|
68
|
+
|
|
69
|
+
Test table:
|
|
70
|
+
<table id="datatable">
|
|
71
|
+
<tr>
|
|
72
|
+
<th>Column 1</th>
|
|
73
|
+
<th>Column "cool" 2</th>
|
|
74
|
+
<th>Column 3</th>
|
|
75
|
+
<th>Column 4</th>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td>100,111</td>
|
|
79
|
+
<td>200</td>
|
|
80
|
+
<td>030</td>
|
|
81
|
+
<td>áéíóú</td>
|
|
82
|
+
</tr>
|
|
83
|
+
<tr>
|
|
84
|
+
<td>400</td>
|
|
85
|
+
<td>500</td>
|
|
86
|
+
<td>Chinese chars: 解决导出csv中文乱码问题</td>
|
|
87
|
+
<td>àèìòù</td>
|
|
88
|
+
</tr>
|
|
89
|
+
<tr>
|
|
90
|
+
<td>Text</td>
|
|
91
|
+
<td>More text</td>
|
|
92
|
+
<td>Text with
|
|
93
|
+
new line</td>
|
|
94
|
+
<td>ç ñ ÄËÏÖÜ äëïöü</td>
|
|
95
|
+
</tr>
|
|
96
|
+
</table>
|
|
97
|
+
|
|
98
|
+
<br/>
|
|
99
|
+
|
|
100
|
+
<a download="somedata.xls" href="#" onclick="return ExcellentExport.excel(this, 'datatable', 'Sheet Name Here');">Export to Excel</a>
|
|
101
|
+
<br/>
|
|
102
|
+
|
|
103
|
+
<a download="somedata.csv" href="#" onclick="return ExcellentExport.csv(this, 'datatable');">Export to CSV - UTF8</a>
|
|
104
|
+
<br/>
|
|
105
|
+
<a download="somedata.csv" href="#" onclick="return ExcellentExport.csv(this, 'datatable', ';');">Export to CSV - Using semicolon ";" separator - UTF8</a>
|
|
106
|
+
<br/>
|
|
107
|
+
<h1>NEW API!</h1>
|
|
108
|
+
<a download="data_123.xls" href="#" id="anchorNewApi-xls" onclick="return newApi('xls');">Export to Excel: XLS format</a>
|
|
109
|
+
<br/>
|
|
110
|
+
<a download="data_123.xlsx" href="#" id="anchorNewApi-xlsx" onclick="return newApi('xlsx');">Export to Excel: XLSX format</a>
|
|
111
|
+
<br/>
|
|
112
|
+
<a download="data_123.csv" href="#" id="anchorNewApi-csv" onclick="return newApi('csv');">Export to CSV</a>
|
|
113
|
+
<br>
|
|
114
|
+
<a href="#" id="anchorNewApi-xlsx-some" onclick="return exportSome();">Export to Excel: XLSX filtering columns and rows</a>
|
|
115
|
+
<br/>
|
|
116
|
+
<br/>
|
|
117
|
+
|
|
118
|
+
<h1>NEW API from Arrays!</h1>
|
|
119
|
+
|
|
120
|
+
<a href="#" id="anchorNewApi-xlsx-array" onclick="return newApiArray('xlsx');">Export to XLSX from array</a>
|
|
121
|
+
<br>
|
|
122
|
+
<a href="#" id="anchorNewApi-xls-array" onclick="return newApiArray('xls');">Export to XLS from array</a>
|
|
123
|
+
<br>
|
|
124
|
+
<a href="#" id="anchorNewApi-csv-array" onclick="return newApiArray('csv');">Export to CSV from array</a>
|
|
125
|
+
|
|
126
|
+
</body>
|
|
127
|
+
</html>
|
package/index.noanchor.html
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<meta charset="utf-8">
|
|
4
|
-
<title>Export to excel test</title>
|
|
5
|
-
<script src="dist/excellentexport.js"></script>
|
|
6
|
-
<style>
|
|
7
|
-
table, tr, td {
|
|
8
|
-
border: 1px black solid;
|
|
9
|
-
}
|
|
10
|
-
</style>
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function triggerDownload() {
|
|
15
|
-
ExcellentExport.convert({ filename: 'fileTriggeredAutomatically', format: 'xlsx', openAsDownload: true},[{name: 'Sheet 1', from: {array: [[1,2,3],[4,5,6]]}},{name: 'Sheet 2', from: {array: [['this is text'],['this is also text']]}}]);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
document.addEventListener("DOMContentLoaded", triggerDownload);
|
|
19
|
-
|
|
20
|
-
</script>
|
|
21
|
-
</head>
|
|
22
|
-
<body>
|
|
23
|
-
<h1>ExcellentExport.js</h1>
|
|
24
|
-
|
|
25
|
-
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
26
|
-
|
|
27
|
-
<h3>Test without anchor tab</h3>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</body>
|
|
31
|
-
</html>
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<title>Export to excel test</title>
|
|
5
|
+
<script src="dist/excellentexport.js"></script>
|
|
6
|
+
<style>
|
|
7
|
+
table, tr, td {
|
|
8
|
+
border: 1px black solid;
|
|
9
|
+
}
|
|
10
|
+
</style>
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function triggerDownload() {
|
|
15
|
+
ExcellentExport.convert({ filename: 'fileTriggeredAutomatically', format: 'xlsx', openAsDownload: true},[{name: 'Sheet 1', from: {array: [[1,2,3],[4,5,6]]}},{name: 'Sheet 2', from: {array: [['this is text'],['this is also text']]}}]);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
document.addEventListener("DOMContentLoaded", triggerDownload);
|
|
19
|
+
|
|
20
|
+
</script>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<h1>ExcellentExport.js</h1>
|
|
24
|
+
|
|
25
|
+
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
26
|
+
|
|
27
|
+
<h3>Test without anchor tab</h3>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|