You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Denis Sitnitsa <pi...@gmail.com> on 2012/05/18 21:56:10 UTC

Format as a table in Excel

Hi Everybody,

This is the first time I'm working with Apache Poi and I have a question.

In Excel you can press "Format as a table" button and you grid will have
frozen top row, enabled filter, optional total row and nice view.

How can I do the same using Apache Poi?

Thanks.

Re: Format as a table in Excel

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
You will have to write code to perform all of these options I am sorry to
say.

The best place to start would be to take a look at the Quick Guide -
http://poi.apache.org/spreadsheet/quick-guide.html - which shows you how to
create Autofilters and freeze panes. How to create an optional totals row is
something that I am not at all clear on as, to be honest, I do not know what
it looks like, but am confident it should (might) be possible. As to
appearance, well, you will have to create that yourself by formatting cells.

All possible but it will require code. There are plenty of people on the
list who can help you out when you hit specific problems. Also, you may want
to take a look at the examples section -
http://poi.apache.org/spreadsheet/examples.html. It contains lots of code
demonstrating how to 'real world' worksheets. If it were me - and this is
not meant to sound patronising so forgive me please if it does as that was
not my intention - I would begin by writing the code to simply create the
table, headings and all. Next, find out how to create the style objects for
the header row and then move on to styling the cells in the rest of the
table. Then, look at locking the header and the autofilter before tackling
the optional totals row. Must admit that it is the final step that most
intrigues me and I hope we can help you to achieve it.



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Format-as-a-table-in-Excel-tp5709811p5709813.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