OO-Snippets: add autofilter

Commons

Keywordsautofilter, database range, filter
LanguageOOBasic
ApplicationCalc
AuthorsTom Schindl (initial)
Supported Versions
Supported OS
Question How can I add an auto-filter using the api
Answer

Code-Snippet-Listing (snippet-source)

Dim rangeAddress As new com.sun.star.table.CellRangeAddress
rangeAddress.Sheet = 1
rangeAddress.StartColumn = 0
rangeAddress.StartRow = 0
rangeAddress.EndColumn = 4
rangeAddress.EndRow = 5

Dim CalcDoc As Object
CalcDoc = ThisComponent
CalcDoc.DatabaseRanges.addNewByName( "myRange", rangeAddress )
CalcDoc.DatabaseRanges.getByIndex(0).AutoFilter=true 

Changelog

DateUserModification
2004-10-16tomsontomInitial version

and