Please note that the AutoFilter feature does no operate in LibreOffice

https://datatables.net/extensions/buttons/examples/html5/excelAutoFilter.html

Indeed, the example file does not open in LibreOffice
with AutoFilter.

When I read the file with OpenPyXL, I can see that auto_filter is on $A$2:$F$59. If I write the file and open it in LibreOffice, it works as expected.

What is DataTables doing to make it work in Excel but not LibreOffice?

2 characters in \xl\workbook.xml.
Now:

<definedNames>
<definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">'Exported data'!$A$2:F59</definedName>
</definedNames>

Must be:

<definedNames>
<definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">'Exported data'!$A$2:$F$59</definedName>
</definedNames>

( now $A$2:F59 instead of $A$2:$F$59).
If we add these 2 symbols to the archive (.xlsx) the file will open normally in Excel and Calc.

3 Likes

I download the xlsx.
Remove row 60.
Freeze at row 3.
Select A2:A59 (header row with data)
menu:Data>Define… and enter name “Data”
menu:Data>Autofilter
Save as ods.

DataTables example - Calc - auto filter.ods (35.3 KB)

Thank you!

I confirmed that I was able to make it work by making the change in xl/workbook.xml.

So…should LibreOffice support this in order to be Excel-compatible? Ick.

IMHO, LO should not be fully compatible with any other software that is intended to be incompatible with anything else.

1 Like

Not to be compatible with excel as reason. I second @Villeroy on this.

But I’d suggest a bug-report at bugzilla anyway, because an address with mix of absolute and relative addressing is not wrong by principle:
$A$2:F59 is a valid range, wich can be adapted by dragging, even if not used for filters.
There may be additional restrictions for autofilter to use only absolute references, but let the developers of LibreOffice decide, if they wish to support this.

2 Likes

:innocent:

Corrected, thank you.