Discussion:
Default Font in Spreadsheet
b***@softhome.net
2003-12-12 16:00:29 UTC
Permalink
I have created a small program that exports data to an Excel spreadsheet using HSSF. My first try at this I set the Font on every cell that I created. I found out however that if the spreadsheet gets very big you get an error when opening the spreadsheet (in Excel). The error says that the maximum number of Fonts has been exceeded.

My question is this. Is there a way in HSSF to set the "Default Font" for an entire spreadsheet? Excel calls it a "Standard Font". Any help here would be appreciated
Brian Andersen
D***@appshare.de
2003-12-13 16:02:18 UTC
Permalink
hi Brian,

create the font once (!) like this:

HSSFFont lvFont = lvWorkbook.createFont();

lvFont.setColor(...);
lvFont.set...

and the use this font for every cell:
aHSSFCellStyle.setFont(lvFont),

cheers

Dirk

-----Ursprüngliche Nachricht-----
Von: ***@softhome.net [mailto:***@softhome.net]
Gesendet: Freitag, 12. Dezember 2003 17:00
An: poi-***@jakarta.apache.org
Betreff: Default Font in Spreadsheet


I have created a small program that exports data to an Excel spreadsheet
using HSSF. My first try at this I set the Font on every cell that I
created. I found out however that if the spreadsheet gets very big you get
an error when opening the spreadsheet (in Excel). The error says that the
maximum number of Fonts has been exceeded.

My question is this. Is there a way in HSSF to set the "Default Font" for
an entire spreadsheet? Excel calls it a "Standard Font". Any help here
would be appreciated
Brian Andersen
Abdul Wahab
2003-12-16 07:12:51 UTC
Permalink
Hi All,

Does anyone having POI-scratchpad example program to read MSWord document.
Im trying with poi-scratchpad-2.0-RC1-20031102.jar parser, but getting
error..

Error - java.io.IOException: Unable to read entire header; -1 bytes read;
expect
ed 512 bytes

Can u help me to solve this issue.

When can we expect HWPF to make fully use of MSWord in java.

Thanks.
s***@accenture.com
2003-12-16 09:04:31 UTC
Permalink
Hi Abdul,

I had a similar problem and I discovered that it had to do with the size of the Word Document you are trying to open. If it has no content (or a small amount) the error you have below occurred for me. Try opening a file that is a couple of paragraphs long. My requirements mean that Documents will always be at least one page of content long so I have not investigated this problem further at present.

Regards,
Simon.

-----Original Message-----
From: Abdul Wahab [mailto:***@erp21.com.my]
Sent: Tue 16/12/2003 07:12
To: POI Users List
Cc:
Subject: POI-Scratchpad



Hi All,

Does anyone having POI-scratchpad example program to read MSWord document.
Im trying with poi-scratchpad-2.0-RC1-20031102.jar parser, but getting
error..

Error - java.io.IOException: Unable to read entire header; -1 bytes read;
expect
ed 512 bytes

Can u help me to solve this issue.

When can we expect HWPF to make fully use of MSWord in java.

Thanks.


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





This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Ryan Ackley
2003-12-16 14:31:57 UTC
Permalink
Please post the entire stacktrace

-Ryan

----- Original Message -----
From: <***@accenture.com>
To: <poi-***@jakarta.apache.org>
Sent: Tuesday, December 16, 2003 4:04 AM
Subject: RE: POI-Scratchpad


Hi Abdul,

I had a similar problem and I discovered that it had to do with the size of
the Word Document you are trying to open. If it has no content (or a small
amount) the error you have below occurred for me. Try opening a file that
is a couple of paragraphs long. My requirements mean that Documents will
always be at least one page of content long so I have not investigated this
problem further at present.

Regards,
Simon.

-----Original Message-----
From: Abdul Wahab [mailto:***@erp21.com.my]
Sent: Tue 16/12/2003 07:12
To: POI Users List
Cc:
Subject: POI-Scratchpad



Hi All,

Does anyone having POI-scratchpad example program to read MSWord document.
Im trying with poi-scratchpad-2.0-RC1-20031102.jar parser, but getting
error..

Error - java.io.IOException: Unable to read entire header; -1 bytes read;
expect
ed 512 bytes

Can u help me to solve this issue.

When can we expect HWPF to make fully use of MSWord in java.

Thanks.


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





This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the email by you is prohibited.




----------------------------------------------------------------------------
----
Post by s***@accenture.com
---------------------------------------------------------------------
Abdul Wahab
2003-12-17 05:38:32 UTC
Permalink
Hi,

Thanks for ur reply. I have solved that problem by giving poi-scratchpad.jar
path prior to poi.jar in classpath. Now its works fine.. But encountring
another problem..

When I try to read the document which contains table formats, throwing
java.lang.NegativeArraySizeException ...

Exception Stack Trace:-

java.lang.NegativeArraySizeException
at
org.apache.poi.hdf.extractor.data.ListTables.createLVL(ListTables.java:206)
at
org.apache.poi.hdf.extractor.data.ListTables.initLFO(ListTables.java:184)
at
org.apache.poi.hdf.extractor.data.ListTables.<init>(ListTables.java:78)
at
org.apache.poi.hdf.extractor.WordDocument.createListTables(WordDocument.java
:1679)
at
org.apache.poi.hdf.extractor.WordDocument.findFormatting(WordDocument.java:4
08)
at
org.apache.poi.hdf.extractor.WordDocument.processComplexFile(WordDocument.ja
va:335)
at
org.apache.poi.hdf.extractor.WordDocument.readFIB(WordDocument.java:287)
at
org.apache.poi.hdf.extractor.WordDocument.<init>(WordDocument.java:239)
at helperbean.DocumentBean.searchInDocFile(DocumentBean.java:322)

Any solution for this problem

Thanks.


-----Original Message-----
From: Ryan Ackley [mailto:***@cfl.rr.com]
Sent: Tuesday, December 16, 2003 10:32 PM
To: POI Users List
Subject: Re: POI-Scratchpad


Please post the entire stacktrace

-Ryan

----- Original Message -----
From: <***@accenture.com>
To: <poi-***@jakarta.apache.org>
Sent: Tuesday, December 16, 2003 4:04 AM
Subject: RE: POI-Scratchpad


Hi Abdul,

I had a similar problem and I discovered that it had to do with the size of
the Word Document you are trying to open. If it has no content (or a small
amount) the error you have below occurred for me. Try opening a file that
is a couple of paragraphs long. My requirements mean that Documents will
always be at least one page of content long so I have not investigated this
problem further at present.

Regards,
Simon.

-----Original Message-----
From: Abdul Wahab [mailto:***@erp21.com.my]
Sent: Tue 16/12/2003 07:12
To: POI Users List
Cc:
Subject: POI-Scratchpad



Hi All,

Does anyone having POI-scratchpad example program to read MSWord document.
Im trying with poi-scratchpad-2.0-RC1-20031102.jar parser, but getting
error..

Error - java.io.IOException: Unable to read entire header; -1 bytes read;
expect
ed 512 bytes

Can u help me to solve this issue.

When can we expect HWPF to make fully use of MSWord in java.

Thanks.


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





This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the email by you is prohibited.




----------------------------------------------------------------------------
----
Post by s***@accenture.com
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-***@jakarta.apache.org
For additional commands, e-mail: poi-user-***@jakarta.apache.org


---
[This E-mail scanned for viruses by iRepublics.com Anti Virus Solutions]


p.s. get your web hosted for free at iRepublics.com
33MB webspace free, SMS messaging, 30 email accounts
Ryan Ackley
2003-12-17 12:07:51 UTC
Permalink
This is a known problem and one of the reasons HWPF is still in scratchpad.
This bug is on the top of my list. I will fix it in the next month or two.

-Ryan

----- Original Message -----
From: "Abdul Wahab" <***@erp21.com.my>
To: "POI Users List" <poi-***@jakarta.apache.org>; "Ryan Ackley"
<***@apache.org>
Sent: Wednesday, December 17, 2003 12:38 AM
Subject: RE: POI-Scratchpad
Post by Abdul Wahab
Hi,
Thanks for ur reply. I have solved that problem by giving
poi-scratchpad.jar
Post by Abdul Wahab
path prior to poi.jar in classpath. Now its works fine.. But encountring
another problem..
When I try to read the document which contains table formats, throwing
java.lang.NegativeArraySizeException ...
Exception Stack Trace:-
java.lang.NegativeArraySizeException
at
org.apache.poi.hdf.extractor.data.ListTables.createLVL(ListTables.java:206)
Post by Abdul Wahab
at
org.apache.poi.hdf.extractor.data.ListTables.initLFO(ListTables.java:184)
at
org.apache.poi.hdf.extractor.data.ListTables.<init>(ListTables.java:78)
at
org.apache.poi.hdf.extractor.WordDocument.createListTables(WordDocument.java
Post by Abdul Wahab
:1679)
at
org.apache.poi.hdf.extractor.WordDocument.findFormatting(WordDocument.java:4
Post by Abdul Wahab
08)
at
org.apache.poi.hdf.extractor.WordDocument.processComplexFile(WordDocument.ja
Post by Abdul Wahab
va:335)
at
org.apache.poi.hdf.extractor.WordDocument.readFIB(WordDocument.java:287)
at
org.apache.poi.hdf.extractor.WordDocument.<init>(WordDocument.java:239)
at helperbean.DocumentBean.searchInDocFile(DocumentBean.java:322)
Any solution for this problem
Thanks.
-----Original Message-----
Sent: Tuesday, December 16, 2003 10:32 PM
To: POI Users List
Subject: Re: POI-Scratchpad
Please post the entire stacktrace
-Ryan
----- Original Message -----
Sent: Tuesday, December 16, 2003 4:04 AM
Subject: RE: POI-Scratchpad
Hi Abdul,
I had a similar problem and I discovered that it had to do with the size of
the Word Document you are trying to open. If it has no content (or a small
amount) the error you have below occurred for me. Try opening a file that
is a couple of paragraphs long. My requirements mean that Documents will
always be at least one page of content long so I have not investigated this
problem further at present.
Regards,
Simon.
-----Original Message-----
Sent: Tue 16/12/2003 07:12
To: POI Users List
Subject: POI-Scratchpad
Hi All,
Does anyone having POI-scratchpad example program to read MSWord document.
Im trying with poi-scratchpad-2.0-RC1-20031102.jar parser, but getting
error..
Error - java.io.IOException: Unable to read entire header; -1 bytes read;
expect
ed 512 bytes
Can u help me to solve this issue.
When can we expect HWPF to make fully use of MSWord in java.
Thanks.
---------------------------------------------------------------------
This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the email by you is prohibited.
--------------------------------------------------------------------------
--
Post by Abdul Wahab
----
Post by s***@accenture.com
---------------------------------------------------------------------
---------------------------------------------------------------------
---
[This E-mail scanned for viruses by iRepublics.com Anti Virus Solutions]
p.s. get your web hosted for free at iRepublics.com
33MB webspace free, SMS messaging, 30 email accounts
Abdul Wahab
2004-01-27 02:48:33 UTC
Permalink
Hello Ryan, Greetings.

Thanks for your effort to come up with good solution on OLE objects.
Is there any latest realease on HWPF.
Still i am encountg "java.lang.NegativeArraySizeException" while my word
document contain table format. is there any short term solution to solve
this problem. My requirement is just to read the whole document.

Thanks,
Abdul Wahab.


-----Original Message-----
From: Ryan Ackley [mailto:***@cfl.rr.com]
Sent: Wednesday, December 17, 2003 8:08 PM
To: POI Users List
Subject: Re: POI-Scratchpad


This is a known problem and one of the reasons HWPF is still in scratchpad.
This bug is on the top of my list. I will fix it in the next month or two.

-Ryan

----- Original Message -----
From: "Abdul Wahab" <***@erp21.com.my>
To: "POI Users List" <poi-***@jakarta.apache.org>; "Ryan Ackley"
<***@apache.org>
Sent: Wednesday, December 17, 2003 12:38 AM
Subject: RE: POI-Scratchpad
Post by Abdul Wahab
Hi,
Thanks for ur reply. I have solved that problem by giving
poi-scratchpad.jar
Post by Abdul Wahab
path prior to poi.jar in classpath. Now its works fine.. But encountring
another problem..
When I try to read the document which contains table formats, throwing
java.lang.NegativeArraySizeException ...
Exception Stack Trace:-
java.lang.NegativeArraySizeException
at
org.apache.poi.hdf.extractor.data.ListTables.createLVL(ListTables.java:206)
Post by Abdul Wahab
at
org.apache.poi.hdf.extractor.data.ListTables.initLFO(ListTables.java:184)
at
org.apache.poi.hdf.extractor.data.ListTables.<init>(ListTables.java:78)
at
org.apache.poi.hdf.extractor.WordDocument.createListTables(WordDocument.java
Post by Abdul Wahab
:1679)
at
org.apache.poi.hdf.extractor.WordDocument.findFormatting(WordDocument.java:4
Post by Abdul Wahab
08)
at
org.apache.poi.hdf.extractor.WordDocument.processComplexFile(WordDocument.ja
Post by Abdul Wahab
va:335)
at
org.apache.poi.hdf.extractor.WordDocument.readFIB(WordDocument.java:287)
at
org.apache.poi.hdf.extractor.WordDocument.<init>(WordDocument.java:239)
at helperbean.DocumentBean.searchInDocFile(DocumentBean.java:322)
Any solution for this problem
Thanks.
-----Original Message-----
Sent: Tuesday, December 16, 2003 10:32 PM
To: POI Users List
Subject: Re: POI-Scratchpad
Please post the entire stacktrace
-Ryan
----- Original Message -----
Sent: Tuesday, December 16, 2003 4:04 AM
Subject: RE: POI-Scratchpad
Hi Abdul,
I had a similar problem and I discovered that it had to do with the size of
the Word Document you are trying to open. If it has no content (or a small
amount) the error you have below occurred for me. Try opening a file that
is a couple of paragraphs long. My requirements mean that Documents will
always be at least one page of content long so I have not investigated this
problem further at present.
Regards,
Simon.
-----Original Message-----
Sent: Tue 16/12/2003 07:12
To: POI Users List
Subject: POI-Scratchpad
Hi All,
Does anyone having POI-scratchpad example program to read MSWord document.
Im trying with poi-scratchpad-2.0-RC1-20031102.jar parser, but getting
error..
Error - java.io.IOException: Unable to read entire header; -1 bytes read;
expect
ed 512 bytes
Can u help me to solve this issue.
When can we expect HWPF to make fully use of MSWord in java.
Thanks.
---------------------------------------------------------------------
This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you have
received it in error, please notify the sender immediately and delete the
original. Any other use of the email by you is prohibited.
--------------------------------------------------------------------------
--
Post by Abdul Wahab
----
Post by s***@accenture.com
---------------------------------------------------------------------
---------------------------------------------------------------------
---
[This E-mail scanned for viruses by iRepublics.com Anti Virus Solutions]
p.s. get your web hosted for free at iRepublics.com
33MB webspace free, SMS messaging, 30 email accounts
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-***@jakarta.apache.org
For additional commands, e-mail: poi-user-***@jakarta.apache.org


---
[This E-mail scanned for viruses by iRepublics.com Anti Virus Solutions]


p.s. get your web hosted for free at iRepublics.com
33MB webspace free, SMS messaging, 30 email accounts

Loading...