You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by calintz <t4...@yahoo.com> on 2010/05/29 08:52:35 UTC

autoSizeColumn issue

Hi all,

I'm currently using poi-3.6 to generate excel file. It is working well in my
development environment(window xp & jdk1.6.0_20). When i try to generate
excel file in my production environment(centOS 5 & OpenJDK 1.6.0-b09), i
found that autoSizeColumn does not produce the output as expected. Am i
missing anything in my production environment or i should not use openjdk?
Please advice.

Regards,
Calintz Tee
-- 
View this message in context: http://old.nabble.com/autoSizeColumn-issue-tp28714294p28714294.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: autoSizeColumn issue

Posted by Bill Stackhouse <bi...@verizon.net>.
As others have mentioned, the font must be installed for autoSizeColumn 
to work. Bug number 48406 also indicated that the incorrect character 
width is used so when a large number of upper case character are in a 
cell, the width might be less than desired.

Bill

On 5/28/10 11:52 PM, calintz wrote:
> Hi all,
>
> I'm currently using poi-3.6 to generate excel file. It is working well in my
> development environment(window xp&  jdk1.6.0_20). When i try to generate
> excel file in my production environment(centOS 5&  OpenJDK 1.6.0-b09), i
> found that autoSizeColumn does not produce the output as expected. Am i
> missing anything in my production environment or i should not use openjdk?
> Please advice.
>
> Regards,
> Calintz Tee
>    


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


Re: autoSizeColumn issue

Posted by calintz <t4...@yahoo.com>.
Hi all,

This issue have been solved!!

Solution:
Fedora / Centos
1. Install the software needed
- sudo yum install rpm-build cabextract

2. Download the specs to build the RPM
- wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec

3. Build the RPM
- rpmbuild -ba msttcorefonts-2.0-1.spec

4. Install the RPM
- rpm -ivh /usr/src/redhat/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm

I'm getting error when doing then third step, so i directly download 
msttcorefonts-2.0-1.noarch.rpm and install it. After that, i restarted my
server and everything work well.


calintz wrote:
> 
> Hi all,
> 
> I'm currently using poi-3.6 to generate excel file. It is working well in
> my development environment(window xp & jdk1.6.0_20). When i try to
> generate excel file in my production environment(centOS 5 & OpenJDK
> 1.6.0-b09), i found that autoSizeColumn does not produce the output as
> expected. Am i missing anything in my production environment or i should
> not use openjdk? Please advice.
> 
> Regards,
> Calintz Tee
> 

-- 
View this message in context: http://old.nabble.com/autoSizeColumn-issue-tp28714294p28720997.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: autoSizeColumn issue

Posted by Richard Holmes <ri...@shedconsulting.co.uk>.
Have a look for windows compatible fonts in ubuntu they are available through the package manager so I am sure it must be similar in centos.

-----Original Message-----
From: Nick Burch <ni...@alfresco.com>
Date: Sat, 29 May 2010 10:32:58 
To: POI Users List<us...@poi.apache.org>
Subject: Re: autoSizeColumn issue

On Fri, 28 May 2010, calintz wrote:
> I'm currently using poi-3.6 to generate excel file. It is working well in my
> development environment(window xp & jdk1.6.0_20). When i try to generate
> excel file in my production environment(centOS 5 & OpenJDK 1.6.0-b09), i
> found that autoSizeColumn does not produce the output as expected.

autoSizeColumn relies on finding a close enough font to be able to figure 
out how wide to make the column be. I bet you have the correct fonts on 
your dev box, but not in production. Try installing some more fonts 
(ideally the ones you use in excel!) on the production box, make sure that 
java there can see them, then retry your code

Nick

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


Re: autoSizeColumn issue

Posted by calintz <t4...@yahoo.com>.
Previously i set my font to arial and bold in my application, i found a big
different between the outcome and what i expected. Later on, i tried to
remove bold font, the outcome from autoSizeColumn looks better but i think
the arial font still cannot be recognized. Any idea on how to install needed
font in my production server? Below are output from $JAVA_HOME/jre/lib/


accessibility.properties          fontconfig.Ubuntu.properties.src
amd64                             im
applet                            images
audio                             jce.jar
calendars.properties              jexec
charsets.jar                      jsse.jar
classlist                         jvm.hprof.txt
cmm                               logging.properties
content-types.properties          management
currency.data                     management-agent.jar
ext                               meta-index
flavormap.properties              net.properties
fontconfig.bfc                    psfontj2d.properties
fontconfig.Fedora.bfc             psfont.properties.ja
fontconfig.Fedora.properties.src  resources.jar
fontconfig.properties.src         rt.jar
fontconfig.SuSE.bfc               security
fontconfig.SuSE.properties.src    sound.properties
fontconfig.Ubuntu.bfc             zi


Nick Burch-11 wrote:
> 
> On Fri, 28 May 2010, calintz wrote:
>> I'm currently using poi-3.6 to generate excel file. It is working well in
>> my
>> development environment(window xp & jdk1.6.0_20). When i try to generate
>> excel file in my production environment(centOS 5 & OpenJDK 1.6.0-b09), i
>> found that autoSizeColumn does not produce the output as expected.
> 
> autoSizeColumn relies on finding a close enough font to be able to figure 
> out how wide to make the column be. I bet you have the correct fonts on 
> your dev box, but not in production. Try installing some more fonts 
> (ideally the ones you use in excel!) on the production box, make sure that 
> java there can see them, then retry your code
> 
> Nick
> 
> ---------------------------------------------------------------------
> 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/autoSizeColumn-issue-tp28714294p28716000.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: autoSizeColumn issue

Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 28 May 2010, calintz wrote:
> I'm currently using poi-3.6 to generate excel file. It is working well in my
> development environment(window xp & jdk1.6.0_20). When i try to generate
> excel file in my production environment(centOS 5 & OpenJDK 1.6.0-b09), i
> found that autoSizeColumn does not produce the output as expected.

autoSizeColumn relies on finding a close enough font to be able to figure 
out how wide to make the column be. I bet you have the correct fonts on 
your dev box, but not in production. Try installing some more fonts 
(ideally the ones you use in excel!) on the production box, make sure that 
java there can see them, then retry your code

Nick

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


Re: autoSizeColumn issue

Posted by calintz <t4...@yahoo.com>.
I'd wrote a simple code to check available fonts in my server. I found that
my server only have few type of fonts.

<body>
<%@page import="java.awt.GraphicsEnvironment;" %>
<% 
	
     GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
     String[] names = ge.getAvailableFontFamilyNames();
     for ( int i=0; i<names.length; i++ )
     {
%>
       <p><%=names[i] %></p>
<%
     }
      
%>
</body>

Output of the above coding:

Dialog
DialogInput
Liberation Mono
Liberation Sans
Liberation Serif
Monospaced
SansSerif
Serif


David Fisher wrote:
> 
> Autosizing requires font information. Check to assure that the fonts
> installed on centOS / Java match those on your WIndows box. You'll likely
> find the CentOS box is missing fonts.
> 
> Regards,
> Dave
> 
> On May 28, 2010, at 11:52 PM, calintz wrote:
> 
>> 
>> Hi all,
>> 
>> I'm currently using poi-3.6 to generate excel file. It is working well in
>> my
>> development environment(window xp & jdk1.6.0_20). When i try to generate
>> excel file in my production environment(centOS 5 & OpenJDK 1.6.0-b09), i
>> found that autoSizeColumn does not produce the output as expected. Am i
>> missing anything in my production environment or i should not use
>> openjdk?
>> Please advice.
>> 
>> Regards,
>> Calintz Tee
>> -- 
>> View this message in context:
>> http://old.nabble.com/autoSizeColumn-issue-tp28714294p28714294.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
>> 
> 
> 
> ---------------------------------------------------------------------
> 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/autoSizeColumn-issue-tp28714294p28720673.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: autoSizeColumn issue

Posted by David Fisher <df...@jmlafferty.com>.
Autosizing requires font information. Check to assure that the fonts installed on centOS / Java match those on your WIndows box. You'll likely find the CentOS box is missing fonts.

Regards,
Dave

On May 28, 2010, at 11:52 PM, calintz wrote:

> 
> Hi all,
> 
> I'm currently using poi-3.6 to generate excel file. It is working well in my
> development environment(window xp & jdk1.6.0_20). When i try to generate
> excel file in my production environment(centOS 5 & OpenJDK 1.6.0-b09), i
> found that autoSizeColumn does not produce the output as expected. Am i
> missing anything in my production environment or i should not use openjdk?
> Please advice.
> 
> Regards,
> Calintz Tee
> -- 
> View this message in context: http://old.nabble.com/autoSizeColumn-issue-tp28714294p28714294.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
> 


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