Bug 27933 - Unable to use a template (xls) file containing a wmf graphic
Summary: Unable to use a template (xls) file containing a wmf graphic
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC All
: P1 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2004-03-25 03:17 UTC by Daniel
Modified: 2007-01-16 01:35 UTC (History)
0 users

Excel file with graphic that caused the problem (21.50 KB, application/excel)
2004-03-26 03:20 UTC, Daniel

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel 2004-03-25 03:17:33 UTC
I was recommended to file this into Buzilla from someone on the POI User list.

Note: The version I am using is POI 2.5 Final (which is not in the version 
list, so I chose 2.0 Final)

-----Original Message-----
From: Daniel Joshua [mailto:daniel.joshua@gridnode.com]
Sent: Tuesday, 23 March, 2004 5:09 PM
To: poi-user@jakarta.apache.org
Subject: RE: Unable to use a template (xls) file containing a wmf


I encountered a similiar problem as Mathieu. (I did a search on the archives
and realised I am not the only one)

Let me state my exact scenario in hopes that my added details will help.

I use POI to create Excel spreadsheets with dynamic data using a template
(.xls) file.
Previously, I was using and older version of POI [File size: 605 KB (620,262
bytes)] which worked fine.
However, I recently upgraded it to POI 2.5 Final, and it started having
I been using the same test files for both versions (if anyone want a copy I
can send it to you).

What happen is that there was a graphic in my excel which caused the
produced Excel file which could not be opened.
Also, there was NO exceptions/errors thrown from POI.

Later when I read the below post, I tried to remove the graphic and 'viola'
it worked correctly.

Has anyone an idea why this is happening? Any quick remedies?

My system specs:
OS: Windows 2000 Server
JRE: 1.4.1_02-b06
Excel 2000 (9.0.2720)


-----Original Message-----
From: mathieu . fretiere
Subject: Unable to use a template (xls) file containing a wmf graphic
Date: Thu, 04 Mar 2004 02:24:47 -0800


my web application creates an Excel sheet with HSSF.
It reads first a template file (an xls file) containing a wmf (Windows
Metafile) graphic.
Sometimes it works fine, if I use a plain wmf (or emf) graphic.
But if the wmf is more complex, Excel cannot read the generated file. This
error message appears in a pop-up : "Impossible to read the file".
It doesn't work either if I use a jpg or tiff graphic.

Where does this issue come from ?
Is the wmf file too big ?

For information, I use :
- Tomcat 4.1.18
- Windows 2000
- IE 6, Excel 2000

Comment 1 Daniel 2004-03-26 03:20:42 UTC
Created attachment 11001 [details]
Excel file with graphic that caused the problem
Comment 2 Daniel 2004-03-26 03:40:51 UTC
I added the Excel file I used for testing POI 2.5 Final as an attachment.

Comment 3 Avik Sengupta 2007-01-16 01:35:23 UTC
Works as of 12Jan2007, Testcase added.