You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Michael L <ic...@gmail.com> on 2009/11/17 23:51:32 UTC

Cellstyle on rows causes filter/sort to not work properly

Hi, I'm having trouble when using CellStyle on cells and being able to sort that
specific column(in excel) if some cells in that column do not have the same
CellStyle on it. I was wondering if there is some workaround on that, or perhaps
I'm using CellStyle wrong?


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


Re: Cellstyle on rows causes filter/sort to not work properly

Posted by MSB <ma...@tiscali.co.uk>.
Thanks for posting Michael, this sort of information may prove useful to
another list member in the future.

Yours

Mark B


Michael L-3 wrote:
> 
> 
> 
> I found the problem. It appears that whenever there was a difference in
> cellstyles in a column, the excel file produced would assume that there
> was a
> data header row and thus the sort would not include the first row. I
> worked
> around this by creating the header row and now I can use cellstyles as
> intended.
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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/Cellstyle-on-rows-causes-filter-sort-to-not-work-properly-tp26399327p26454134.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: Cellstyle on rows causes filter/sort to not work properly

Posted by Michael L <ic...@gmail.com>.

I found the problem. It appears that whenever there was a difference in
cellstyles in a column, the excel file produced would assume that there was a
data header row and thus the sort would not include the first row. I worked
around this by creating the header row and now I can use cellstyles as intended.





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


Re: Cellstyle on rows causes filter/sort to not work properly

Posted by MSB <ma...@tiscali.co.uk>.
Have never heard or seen this before and can I ask you to post your code and
the file please so that we can take a closer look?

Yours

Mark B


Michael L-3 wrote:
> 
> It sorts the column correctly if either all the cells in the column have
> the
> same cellstyle or they all have no cellstyle. It's when there's a mix of
> different types of cellstyles that causes the sort to not do anything on
> the
> columns.
> 
> 
> ---------------------------------------------------------------------
> 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/Cellstyle-on-rows-causes-filter-sort-to-not-work-properly-tp26399327p26441580.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: Cellstyle on rows causes filter/sort to not work properly

Posted by Michael L <ic...@gmail.com>.
It sorts the column correctly if either all the cells in the column have the
same cellstyle or they all have no cellstyle. It's when there's a mix of
different types of cellstyles that causes the sort to not do anything on the
columns.


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


Re: Cellstyle on rows causes filter/sort to not work properly

Posted by MSB <ma...@tiscali.co.uk>.
Must admit that I would not have expected the style to have any impact on the
way Excel sorts. Have you tried creating the workbook exactly as you already
do but not applying any cell styles and then seeing what the result of the
sort is?

Yours

Mark B


Michael L-3 wrote:
> 
> Hi, I'm having trouble when using CellStyle on cells and being able to
> sort that
> specific column(in excel) if some cells in that column do not have the
> same
> CellStyle on it. I was wondering if there is some workaround on that, or
> perhaps
> I'm using CellStyle wrong?
> 
> 
> ---------------------------------------------------------------------
> 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/Cellstyle-on-rows-causes-filter-sort-to-not-work-properly-tp26399327p26411038.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