You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by hartford123 <ka...@yahoo.com> on 2011/01/21 21:03:40 UTC
Need help with org.apache.poi.POIXMLException
In my application, we are upgrading from poi 2.5 version to poi3.7 to
support excel 2007 files. for now I converted HSSF usermodel to XSSF model,
but trying to read .xls file, got the following exception, is it because I
am not reading .xlsx file?
Does XSSF support only excel 2007 files(.xlsx) and not .xls fiiles?
org.apache.poi.POIXMLException:
org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should
contain a content type part [M1.13]
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:186)
at
com.pweh.engtech.readiness.tasks.BaseDocument.retrieveWorkbook(BaseDocument.java:134)
Line number 134 of BaseDocument is in bold below
XSSFWorkbook book;
EngtechEnvironment engtechEnvironment = new
EngtechEnvironment();
templatepath = engtechEnvironment.getBaseDocURL();
template = ConfigurationManager.getAppProperty(workbookName);
String filename = templatepath + template;
logger.debug("*******template file path is********** " + filename);
//................end
try {
//poi3.7
book = new XSSFWorkbook(new FileInputStream(filename));
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Need-help-with-org-apache-poi-POIXMLException-tp3352158p3352158.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: Need help with org.apache.poi.POIXMLException
Posted by Nick Burch <ni...@alfresco.com>.
On Fri, 21 Jan 2011, hartford123 wrote:
> Does XSSF support only excel 2007 files(.xlsx) and not .xls fiiles?
Correct. If you want to use .xls files, you need HSSF. The common SS code
will let you code for both, see the website for details and examples
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Need help with org.apache.poi.POIXMLException
Posted by Nick Burch <ni...@alfresco.com>.
On Mon, 24 Jan 2011, hartford123 wrote:
> I am subscribed user.. why this post is still pending and needs to be
> approved.
You appear to be posting through nabble, rather than to the list directly.
This can sometimes mean you have to wait for your messages to be
moderated. If you subscribe and post directly to the list, this isn't an
issue.
Details on the mailing lists are at:
http://poi.apache.org/mailinglists.html
And you can see which posts have made it to the list at:
http://mail-archives.apache.org/mod_mbox/poi-user/
(You'll see that your POIXMLException post made it to the list, and has
been replied to)
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: Need help with org.apache.poi.POIXMLException
Posted by hartford123 <ka...@yahoo.com>.
I am subscribed user.. why this post is still pending and needs to be
approved.
Approvers,
Can you approve it please.
thanks,
Sujatha.
--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Need-help-with-org-apache-poi-POIXMLException-tp3352158p3354709.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