You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by DavidZaz <dz...@cait.org> on 2010/06/25 14:50:58 UTC

Auto Filter

How do I setup an auto-filter column using Apache POI on a xlsx file?

I've tried googling for the answer and I've found this question asked
several times with either no response or a HSSF specific answer. Should I
add a feature request bug or has this functionality already been
implemented?

Thanks!
-- 
View this message in context: http://old.nabble.com/Auto-Filter-tp28991981p28991981.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Auto Filter

Posted by Yegor Kozlov <ye...@dinom.ru>.
Initial support for auto-filters was committed in r983382.
To test-drive you need to build poi from trunk or download the latest 
daily build from http://encore.torchbox.com/poi-svn-build/

In current version you can only apply auto-filter on a range of cells:

sheet.setAutoFilter(CellRangeAddress.valueOf("C5:F200"));

Customizing of auto-filter properties (filter criteria, sort, etc.) is not yet supported. The feature is available both for HSSF and XSSF.

Yegor

> How do I setup an auto-filter column using Apache POI on a xlsx file?
>
> I've tried googling for the answer and I've found this question asked
> several times with either no response or a HSSF specific answer. Should I
> add a feature request bug or has this functionality already been
> implemented?
>
> Thanks!
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Auto Filter

Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 25 Jun 2010, DavidZaz wrote:
> Can anyone verify that is correct?

I believe it still remains to be added

> If it was not implemented, are there any pointers about how I could get 
> it added?

You'll need to add support for the various records, and then write some 
usermodel code to make it available to the user.

> References:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=35125

This mentions some records that you'll need to add in, and some open 
source code you can crib from.

You'll want to get the microsoft file format specs so you can figure out 
what needs to get written for the new records, a link to them is available 
from: http://poi.apache.org/guidelines.html

I'd suggest you start with trying to write the new records, and send the 
patches in for review. Then, start on the usermodel patches, and do please 
ask for feedback or help on dev@ if you need it! :)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: Auto Filter

Posted by "Jankiraman, Radhakrishnan" <rj...@emptoris.com>.
It might also help to refer to the Open Office XML specification available from http://www.ecma-international.org/publications/standards/Ecma-376.htm. Look for Part 4 which has the reference for the complete spec. 

-Rk

__________________________
Radhakrishnan Jankiraman
(o) +91.20-30239400 extn 520 (c) +91.9822006056

-----Original Message-----
From: DavidZaz [mailto:dzazeski@cait.org] 
Sent: Friday, June 25, 2010 7:02 PM
To: user@poi.apache.org
Subject: RE: Auto Filter


Thanks for the reply.

I performed the following test:

1. Created a new Excel 2007 document in MS Excel 2007.
2. Entered some dummy data.
3. Clicked on the "data" tab. Highlight the columns to be auto-filtered and
click on the "filter" icon.
4. Save the file and close MS Excel.
5. Open the file with OpenOffice.

In my testing, the filter did appear in OpenOffice so it must be stored in
the file somewhere. I'll open up the xlsx file in an editor and see if I can
identify the appropriate tags....


Christian Gosch-2 wrote:
> 
> As far as I remember, Excel AutoFilter is a feature of the application, 
> not the file. If that is not correct, please correct me.
> 
> But what may be part of the file is a specific filter, since Excel knows 
> of a stored filter when the file is opened again.
> 
> Another way to check this is to open a prepared file with OOo: If the 
> filter is recognized there, then there obviously must be some way to 
> detect it.
> 
> If on the other hand OOo can set up such a filter, and afterwards Excel 
> can recognize it, there obviously must be some way to put that into the 
> file.
> 
> --cg
> 
> 
>> -----Original Message-----
>> From: DavidZaz [mailto:dzazeski@cait.org]
>> Sent: Friday, June 25, 2010 3:14 PM
>> To: user@poi.apache.org
>> Subject: Re: Auto Filter
>> 
>> 
>> I did some more research and found bug 35125 in the bug database. It 
> was
>> reported in 2005, but it doesn't look active. It looks like 
> auto-filter
>> was
>> never implemented.
>> 
>> Can anyone verify that is correct? If it was not implemented, are 
> there
>> any
>> pointers about how I could get it added?
>> 
>> References:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=35125
>> 
>> 
>> DavidZaz wrote:
>> >
>> > How do I setup an auto-filter column using Apache POI on a xlsx 
> file?
>> >
>> > I've tried googling for the answer and I've found this question 
> asked
>> > several times with either no response or a HSSF specific answer. 
> Should
>> I
>> > add a feature request bug or has this functionality already been
>> > implemented?
>> >
>> > Thanks!
>> >
>> 
>> --
>> View this message in context: http://old.nabble.com/Auto-Filter-
>> tp28991981p28992209.html
>> Sent from the POI - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>> 
>> 
>> !DSPAM:4c24abb217327074515327!
>> 
>> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Auto-Filter-tp28991981p28992392.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: Auto Filter

Posted by DavidZaz <dz...@cait.org>.
Thanks for the reply.

I performed the following test:

1. Created a new Excel 2007 document in MS Excel 2007.
2. Entered some dummy data.
3. Clicked on the "data" tab. Highlight the columns to be auto-filtered and
click on the "filter" icon.
4. Save the file and close MS Excel.
5. Open the file with OpenOffice.

In my testing, the filter did appear in OpenOffice so it must be stored in
the file somewhere. I'll open up the xlsx file in an editor and see if I can
identify the appropriate tags....


Christian Gosch-2 wrote:
> 
> As far as I remember, Excel AutoFilter is a feature of the application, 
> not the file. If that is not correct, please correct me.
> 
> But what may be part of the file is a specific filter, since Excel knows 
> of a stored filter when the file is opened again.
> 
> Another way to check this is to open a prepared file with OOo: If the 
> filter is recognized there, then there obviously must be some way to 
> detect it.
> 
> If on the other hand OOo can set up such a filter, and afterwards Excel 
> can recognize it, there obviously must be some way to put that into the 
> file.
> 
> --cg
> 
> 
>> -----Original Message-----
>> From: DavidZaz [mailto:dzazeski@cait.org]
>> Sent: Friday, June 25, 2010 3:14 PM
>> To: user@poi.apache.org
>> Subject: Re: Auto Filter
>> 
>> 
>> I did some more research and found bug 35125 in the bug database. It 
> was
>> reported in 2005, but it doesn't look active. It looks like 
> auto-filter
>> was
>> never implemented.
>> 
>> Can anyone verify that is correct? If it was not implemented, are 
> there
>> any
>> pointers about how I could get it added?
>> 
>> References:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=35125
>> 
>> 
>> DavidZaz wrote:
>> >
>> > How do I setup an auto-filter column using Apache POI on a xlsx 
> file?
>> >
>> > I've tried googling for the answer and I've found this question 
> asked
>> > several times with either no response or a HSSF specific answer. 
> Should
>> I
>> > add a feature request bug or has this functionality already been
>> > implemented?
>> >
>> > Thanks!
>> >
>> 
>> --
>> View this message in context: http://old.nabble.com/Auto-Filter-
>> tp28991981p28992209.html
>> Sent from the POI - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>> 
>> 
>> !DSPAM:4c24abb217327074515327!
>> 
>> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Auto-Filter-tp28991981p28992392.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


RE: Auto Filter

Posted by Christian Gosch <ch...@inovex.de>.
As far as I remember, Excel AutoFilter is a feature of the application, 
not the file. If that is not correct, please correct me.

But what may be part of the file is a specific filter, since Excel knows 
of a stored filter when the file is opened again.

Another way to check this is to open a prepared file with OOo: If the 
filter is recognized there, then there obviously must be some way to 
detect it.

If on the other hand OOo can set up such a filter, and afterwards Excel 
can recognize it, there obviously must be some way to put that into the 
file.

--cg


> -----Original Message-----
> From: DavidZaz [mailto:dzazeski@cait.org]
> Sent: Friday, June 25, 2010 3:14 PM
> To: user@poi.apache.org
> Subject: Re: Auto Filter
> 
> 
> I did some more research and found bug 35125 in the bug database. It 
was
> reported in 2005, but it doesn't look active. It looks like 
auto-filter
> was
> never implemented.
> 
> Can anyone verify that is correct? If it was not implemented, are 
there
> any
> pointers about how I could get it added?
> 
> References:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=35125
> 
> 
> DavidZaz wrote:
> >
> > How do I setup an auto-filter column using Apache POI on a xlsx 
file?
> >
> > I've tried googling for the answer and I've found this question 
asked
> > several times with either no response or a HSSF specific answer. 
Should
> I
> > add a feature request bug or has this functionality already been
> > implemented?
> >
> > Thanks!
> >
> 
> --
> View this message in context: http://old.nabble.com/Auto-Filter-
> tp28991981p28992209.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> !DSPAM:4c24abb217327074515327!
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Auto Filter

Posted by DavidZaz <dz...@cait.org>.
I did some more research and found bug 35125 in the bug database. It was
reported in 2005, but it doesn't look active. It looks like auto-filter was
never implemented.

Can anyone verify that is correct? If it was not implemented, are there any
pointers about how I could get it added?

References:
https://issues.apache.org/bugzilla/show_bug.cgi?id=35125


DavidZaz wrote:
> 
> How do I setup an auto-filter column using Apache POI on a xlsx file?
> 
> I've tried googling for the answer and I've found this question asked
> several times with either no response or a HSSF specific answer. Should I
> add a feature request bug or has this functionality already been
> implemented?
> 
> Thanks!
> 

-- 
View this message in context: http://old.nabble.com/Auto-Filter-tp28991981p28992209.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org