You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Vaidiyanathan, Senthilkumar" <se...@credit-suisse.com> on 2008/06/17 05:36:24 UTC

Please help me on this

Hi All,
I'm generating an Excel spreadsheet dynamically (using Java/POI).I get a
warning message saying "Some text formatting may have changed in this
file because the maximum number of fonts was exceeded. It may help to
close other documents and try again". This occurs even when no other
files are open and the excel is huge.
When I am generating excel,  creating  HSSFCellStyle instance more than
200. will it cause this issue?.
It is really urgent for us.

Regards
Senthil.

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

Re: Please help me on this

Posted by Nispaara Solutions <ni...@gmail.com>.
Hi Nick,
it's a great advise. Saved lot of time.
Thanx a lot for showing right path.I had misunderstood.

Thanx again.........

On Tue, Jun 17, 2008 at 4:31 PM, Nick Burch <ni...@torchbox.com> wrote:

> On Tue, 17 Jun 2008, Nispaara Solutions wrote:
> > Some where i've read getPhysicalRowAt(x) and getPhysicalCellAt(x)
> > methods give me the exact location of the rows and cells respectively.
> > Unfortunately these 2 methods are not avialable in apache poi.
>
> I think you're going about this the wrong way, you shouldn't need to be
> doing anything like that
>
> Your two main options for looping over all the data in hssf are:
> * go from row 0 to the last row, ditto for cells. Check for nulls
> * use the iterators - http://poi.apache.org/hssf/quick-guide.html#Iterator
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Please help me on this

Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 17 Jun 2008, Nispaara Solutions wrote:
> Some where i've read getPhysicalRowAt(x) and getPhysicalCellAt(x)
> methods give me the exact location of the rows and cells respectively.
> Unfortunately these 2 methods are not avialable in apache poi.

I think you're going about this the wrong way, you shouldn't need to be
doing anything like that

Your two main options for looping over all the data in hssf are:
* go from row 0 to the last row, ditto for cells. Check for nulls
* use the iterators - http://poi.apache.org/hssf/quick-guide.html#Iterator

Nick

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


Re: Please help me on this

Posted by Nispaara Solutions <ni...@gmail.com>.
Hi,
I mean to say,
1) if we use getPhysicalNumberOfRows() method to get no. of rows in a sheet,
it returns only the no or rows that've got the data, excluding empty rows.
2) After getting no. of rows in a sheet our job is to iterate through all
rows and cells
3) In our sheet if we've any empty row then, getRow(x) will not give the
exact location of the row which contain data.
4) Same issue when iterating through all cells in a row too.

Some where i've read getPhysicalRowAt(x) and getPhysicalCellAt(x) methods
give me the exact location of the rows and cells respectively. Unfortunately
these 2 methods are not avialable in apache poi.

Hope you can understand what  exactly is my problem.

Please help me out.

Thanks a lot.


On Tue, Jun 17, 2008 at 3:43 PM, Nick Burch <ni...@torchbox.com> wrote:

> On Tue, 17 Jun 2008, Nispaara Solutions wrote:
> > Could anyone tell me, is there a way to find physical location of Row &
> > cell in an excel file using apache poi.
>
> I'm struggling to figure out what you mean by the physical location of a
> row in an excel file. Do you mean something like the underlying record
> is 1521 bytes into the file? Do you want to know it's on the usb flash
> disk you accidently left at home today?
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Please help me on this

Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 17 Jun 2008, Nispaara Solutions wrote:
> Could anyone tell me, is there a way to find physical location of Row &
> cell in an excel file using apache poi.

I'm struggling to figure out what you mean by the physical location of a
row in an excel file. Do you mean something like the underlying record
is 1521 bytes into the file? Do you want to know it's on the usb flash
disk you accidently left at home today?

Nick

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


Re: Please help me on this

Posted by Nispaara Solutions <ni...@gmail.com>.
Hi,
Could anyone tell me, is there a way to find physical location of Row & cell
in an excel file using apache poi.

Thanks in advance..................

On Tue, Jun 17, 2008 at 2:18 PM, Nick Burch <ni...@torchbox.com> wrote:

> On Tue, 17 Jun 2008, Vaidiyanathan, Senthilkumar wrote:
> > Hi All, I'm generating an Excel spreadsheet dynamically (using
> > Java/POI).I get a warning message saying "Some text formatting may have
> > changed in this file because the maximum number of fonts was exceeded.
> > It may help to close other documents and try again".
>
> This is most commonly caused by creating cell styles inside your per-row
> loop. Create them all outside of the main loop, so you only have one copy
> of each style per file. Multiple copies of each style per file make excel
> unhappy, as you quickly end up with more than it's little brain can handle
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Please help me on this

Posted by Nick Burch <ni...@torchbox.com>.
On Tue, 17 Jun 2008, Vaidiyanathan, Senthilkumar wrote:
> Hi All, I'm generating an Excel spreadsheet dynamically (using
> Java/POI).I get a warning message saying "Some text formatting may have
> changed in this file because the maximum number of fonts was exceeded.
> It may help to close other documents and try again".

This is most commonly caused by creating cell styles inside your per-row
loop. Create them all outside of the main loop, so you only have one copy
of each style per file. Multiple copies of each style per file make excel
unhappy, as you quickly end up with more than it's little brain can handle

Nick

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