You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Nikita Voitov <nv...@gmail.com> on 2011/05/18 12:03:02 UTC

Count page numbers during iteration through spreed sheet cells.

Hi Guys,

I have xls spreed sheet with about 500-600 rows in a table (table has three
columns). I need to extract value from the 2nd column on each row and at the
same time to keep track of current page number. So, as result I want to get
hashmap<String, Integer>, where key represents cell value and Integer
represents page number where this cell is located.

Unfortunatly, I can't find some standard methods in API to get page number
during cells parsing. One possible solution that I found is to cut all sheet
into pages and count the number of page breaks and use it further in order
to split all rows into ranges and than iterate through them range by
range...so, I did it, but it's too complicated...may be there is should be
more right way?

Thanks!

-- 
Cheers, Nikita.

Re: Count page numbers during iteration through spreed sheet cells.

Posted by Nikita Voitov <nv...@gmail.com>.
Thanks Nick,

Page size is standard A4 page.
>try to work out the space taken up by every cell
Which one of printing settings can I use in order to know how much space
(units?) every cell fills?

On Wed, May 18, 2011 at 2:12 PM, Nick Burch <ni...@alfresco.com> wrote:

> On Wed, 18 May 2011, Nikita Voitov wrote:
>
>> Unfortunatly, I can't find some standard methods in API to get page number
>> during cells parsing.
>>
>
> POI doesn't currently track page numbers, and they're not stored in the
> file format. You'd need to look at the printer settings to figure out the
> page sizing, then try to work out the space taken up by every cell to track
> when it falls off the bottom of a page...
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>


-- 
Cheers, Nikita.

Re: Count page numbers during iteration through spreed sheet cells.

Posted by Nick Burch <ni...@alfresco.com>.
On Wed, 18 May 2011, Nikita Voitov wrote:
> Unfortunatly, I can't find some standard methods in API to get page 
> number during cells parsing.

POI doesn't currently track page numbers, and they're not stored in the 
file format. You'd need to look at the printer settings to figure out the 
page sizing, then try to work out the space taken up by every cell to 
track when it falls off the bottom of a page...

Nick

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