Add autofilter or sort properties #472
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#472
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
I have to do an export in excel where autofilter or sort is required. If i add similar as below code in xlsx.js or minified file, it works. But on server, we get the js-xlsx files from bower directly, so I can not use the locally edited files. Would you be willing to edit the files for filtering or sorting ?
In function write_ws_xml(idx, opts, wb) {
...
at line no 7562-->o[o.length]=writextag("autoFilter",null,{ref:ref});
...
}
Can You share example how to add autoFilter for header?
Sure. Edit write_ws_xml(idx, opts, wb) function in xlsx.js or its minified, depending on which one is referred, and add the bold text in between the other code lines.
`if(o.length>sidx+1) { o[o.length] = (''); o[sidx]=o[sidx].replace("/>",">"); }
o[o.length]=writextag('autoFilter',null,{ref:ref});
if(ws['!merges'] !== undefined && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));`
Thank You! It's works fine!
I suggest send your changes as pull request.
We're attaching the autofilter range as the
ref
key of the'!autofilter'
key of each worksheet. In future commits we will add more features, but for now basic autofilters can be passed with:We're pushing a change to add autofilter metadata in the worksheet
!autofilter
key. For now it just supports a reference, but later we will add more.