Questions about Apache POI

If you have experience with Apache POI, please help me!
(1) HWPF is in POI API documentation (javadoc), but I didn't find the classes in the jar (jakarta-poi-1.5.1-final-20020615.jar). Did I miss something?
(2) Is HDF substituting HWPF?
(3) Is it possible to create Word file with HWPF or HDF? If so, is it possible to create tables in the Word file?
Thanks! I understand there has been lots of discussion of this topic, but I've not been able to find anything substantial, and have to ask questions here again.

The HWPF is in early stages of developement, therefore it is not included into the final distribution. Try poi-scratchpad-2.5.1-final-20040804.jar. Here you will find the classes you need
About creating word documents, it can be done using HWPF, but i suggest you to try itext which will generate rtf (http://www.lowagie.com/iText/docs.html). It's quite simple to create tables.

Similar Messages

  • Question about using POI

    Well, I have a client who would like it to be possible for information from the site to be made available as excell data. The site is done in PHP, but PHP doesn't have any libraries to do this with. As it stands I'll probably end up using CSV's named .xls, but it isn't possible to have multiple pages and a lot of other features.
    After some R&D I found POI from jakarta. I'll be honest, I'm new to java and normally wouldn't concider using it for something like this but the POI code didn't really look that bad.
    Three big obsticals now though:
    - Getting POI running (it's asking me to build it with ant, not sure if it's nessacary but it's the only way they gave instructions too, lol. Ant is downloading now.
    - Getting POI running on the server (server is linux and doesn't have jre but I've 'played' with running apps on it before; can at least look that up in my books or online).
    - Getting data from mysql database to php (easiest way would probably be to output data as files from php, send the name into my program, execucute it from the php script, have the program make the .xls file and have php link to it -- leaving out security issues to be addressed)
    Two questions for you guys:
    Does this sound like a decent approach or not?
    Does anyone know how to setup POI? From what I saw in the poi folder, and read about ant I'm hoping this will be like make in linux.
    Thanks

    Not sure what your refering too. I looked over a bunch of posts trying to figure out how to set it up but no one ever really replies with anything helpful.
    Couple people said they were having bugs / errors but didn't really seem like it was the libraries fault, and they all were about reading data, not wrting it.
    Care to elaborate?

  • Question about Apache package.

    Is it possible to include a version "mpm = worker" and "mpm = event" of httpd?. As does RHEL (httpd, httpd.event, httpd.worker)
    Sometimes you need the support of these types of httpd (threaded,forked,etc) for certain software.
    Cheers.

    http://thread.gmane.org/gmane.linux.arch.devel/686
    Pierre started to discuss this on the mailing list.
    Seems like these are going to be the future defauls
    greetz
    hrist

  • Apache Poi Excel Question

    If I use Apacha Poi to create an xls on a machine that doesn't have excel, can I still read the values using Apache Poi HSSF of the create xls?

    yes, POI is independent of Excel being installed.

  • How to read .XLSX files using org.apache.poi.ss.usermodel.* classes

    Hello,
    I want to read in excel files to a JTable. I was able to read in .xls files, but have problems reading .xlsx files. Maybe there is something i need to add to the following code:
    FileInputStream iStream = new FileInputStream(newFile);
    POIFSFileSystem fs = new POIFSFileSystem(iStream);
    Workbook wb1 = WorkbookFactory.create(fs);
    Sheet sheet = wb1.getSheetAt(0);       // get the first sheet data
    // Iterate over each row in the sheet
      Iterator rows = sheet.rowIterator();
       while(rows.hasNext()) {
          Row row = (Row) rows.next();
          .............The compiler is complaining about the 3rd line: Workbook wb1 = WorkbookFactory.create(fs);
    Thanks.

    @ejp:
    I quite agree with you. It's a runtime exception -
    org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)I've tried searching before coming here to ask. HSSF processes .xls files only, XSSF processes .xlsx files only while SS is supposed to read both .xls and .xlsx files. Maybe there's anyone that has used it before who can help out.
    Thanks

  • Excel File Management Apache POI HSSF vs. jxl jar

    I've been reviewing Java technologies for managing Excel files, and I'm a little confused about the differences between Apache's POI HSSF implementation and JExcelApi, and utimately what technology it makes sense to use.
    They are both open source, although POI is backed by Apache, where JExcelApi seems to be open source developed by Andy Khan. It seem Apache has a little more weight, therefore may be a better option.
    Can someone who has exposure to these technologies please provide me with some insight.
    Thanks.

    Hi
    Thanks for your reply,
    Now I hav used an alternate approach of using Apache POI.
    But.......
    I have created simple table in jsp and set content type to
    <%@ page contentType="application/vnd.ms-excel" %>
    when i navigate to this jsp it is getting displayed in excel format.
    I wish if user clicks on to navigate for this jsp, he must get an option to either open, save or cancel the jsp.
    Then on selecting save a dialogue gets appeared where he can select path and file name.
    Please comment.
    Thanks.

  • Question about dependent projects (and their libraries) in 11g-Oracle team?

    Hello everyone,
    I have a question about dependent projects. An example:
    In JDeveloper 10.1.3.x if you had for instance 2 projects (in a workspace): project 1 has one project library (for instance a log4j library) and project 2 is a very simple webapplication which is dependent on project 1. Project 2 has one class which makes use of log4j.
    This compiles fine, you can run project 2 in oc4j, and the libraries of project 1 (log4j) are added on the classpath and everything works fine. This is great for rapid testing as well as keeping management of libraries to a minimum (only one project where you would update a library e.g.)
    However in 11g this approach seems not to work at all anymore now that weblogic is used, not even when 'export library' is checked in project 1. The library is simply never exported at all - with a noclassdeffound error as result. Is this approach still possible (without having to define multiple deployment profiles), or is this a bug?
    Thanks!
    Martijn
    Edited by: MartijnR on Oct 27, 2008 7:57 AM

    Hi Ron,
    I've tried what you said, indeed in that .beabuild.txt when 'deploy by default' is checked it adds a line like: C:/JDeveloper/mywork/test2/lib/log4j-1.2.14.jar = test2-view-webapp/WEB-INF/lib/log4j-1.2.14.jar
    Which looks fine, except that /web-inf/lib/ is empty. I presume its a sort of mapping to say: Load it like it in WEB-INF/lib? This line is not there when the deploy by default is not checked.
    I modified the TestBean as follows (the method that references Log4j does it thru a Class.forName() now only):
    public String getHelloWorld() {
    try {
    Class clazz = Class.forName("org.apache.log4j.Logger");
    System.out.println(clazz.getName());
    catch(Exception e) {
    e.printStackTrace();
    return "Hello World";
    In both cases with or without line, it throws:
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:42)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at nl.test.TestBean.getHelloWorld(TestBean.java:15)
    Secondly I added weblogic.xml with your suggested code, in the exploded war this results in a weblogic.xml which looks like:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    <jsp-descriptor>
    <debug>true</debug>
    <working-dir>/C:/JDeveloper/mywork/test2/view/classes/.jsps</working-dir>
    <keepgenerated>true</keepgenerated>
    </jsp-descriptor>
    <library-ref>
    <library-name>jstl</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    </weblogic-web-app>
    The only thing from me is that container-descriptor tag, the rest is added to it during the deployment. Unfortunately, it still produces the same error. :/ Any clue?

  • Question about document/literal web service

    Hello every body.
    I have some question about document/literal web service.
    I’ve been working with Axis before.
    Axis has four valid signatures for your message-style service methods:
    public Element [] method(Element [] bodies);
    public SOAPBodyElement [] method (SOAPBodyElement [] bodies);
    public Document method(Document body);
    public void method(SOAPEnvelope req, SOAPEnvelope resp);
    The same I am trying to do with WebLogic API for webservices.
    But when I am trying to test web service (public Document method (Document body); )
    I have serialized exceptions for org.w3c.dom.Document.
    Do I have to write a custom class for org.w3c.dom.Document serialization?
    If yes can you give me some idea or example?
    The all idea behind this web service is. I have just one web service and mane classes for XML processing. Depends what xml document will be during runtime, web service will be using different class for xml processing. It works fine with Axis, but in case of WebLogic I have some problem.
    One more question… How I have to call this web service from java client?
    I have seen this example http://www.manojc.com/?sample31 ,
    but this web service looks like (Document helloDom()). I need to send Document.
    This example works for Dynamic Proxy, but does not work for static call.
    Any ideas?? Thank in advance.

    Hi,
    I am getting a similar issue. I created a Document-style/literal webservice and deployed on Weblogic 9.2 . Then I generated client stubs using clientgen. I get the following exception stack trace:
    java.rmi.RemoteException: web service invoke failed: javax.xml.soap.SOAPException:
    failed to serialize class java.lang.Objectweblogic.xml.schema.binding.SerializationException: type mapping lookup failure on
    class=class com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl TypeMapping=TYPEMAPPING SIZE=3
    ENTRY 1:
    class: java.lang.Object
    xsd_type: ['http://xmlns.ozarkexpress.com/business/sell']:stns:echoDocumentResponse
    ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@1125127
    deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@18dfef8
    ENTRY 2:
    class: java.lang.Object
    xsd_type: ['http://xmlns.ozarkexpress.com/business/sell']:stns:echoDocument
    ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@15e83f9
    deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@2a5330
    ENTRY 3:
    class: java.lang.Object
    xsd_type: ['http://www.w3.org/2001/XMLSchema']:xsd:anyType
    ser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@bb7465
    deser: weblogic.xml.schema.binding.internal.builtin.XSDAnyCodec@d6c16c

  • I hava a question about RMI,please help me!

    Ladys and Gentleman,I hava a question about RMI.I wirte four little programs in java that is about RMI on my PC.
    import java.rmi.*;
    public interface AddServerIntf extends Remote{
    double add(double d1,double d2) throws RemoteException;
    import java.rmi.*;
    import java.rmi.server.*;
    public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf{
    public AddServerImpl() throws RemoteException{
    public double add(double d1,double d2)throws RemoteException{
    return d1+d2;
    import java.net.*;
    import java.rmi.*;
    public class AddServer{
    public static void main(String args[]){
    try{
    AddServerImpl addServerImpl=new AddServerImpl();
    Naming.rebind("AddServer",addServerImpl);
    }catch(Exception e){
    e.printStackTrace();
    import java.rmi.*;
    public class AddClient
         public static void main(String args[]){
         try{
         String addServerURL="rmi://"+args[0]+"/AddServer";
         AddServerIntf addServerIntf=(AddServerIntf) Naming.lookup(addServerURL);
         System.out.println("The first number is: "+args[1]);
         double d1=Double.valueOf(args[1]).doubleValue();
         System.out.println("The second number is: "+args[2]);
         double d2=Double.valueOf(args[2]).doubleValue();
         System.out.print("The sum is: "+addServerIntf.add(d1,d2));
         }catch(Exception e){
         System.out.println("Exception: "+e);
    And I compiled these files,so I got 4 class files(AddServer.class,AddServerIntf.class,AddServerImpl.class,AddServerClient.class).Then I use "rmic AddServerImpl" got another two files(AddServerImpl_Skel.class and AddServerImpl_Stub.class).Then I input command:rmiregistry,in another window,I input command:java AddServer,I got some exceptions,I was confused by these exceptions.The exception is:
    D:\MyJava\rmi_3>java AddServer
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: AddServerImpl_Stub
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: AddServerImpl_Stub
    java.lang.ClassNotFoundException: AddServerImpl_Stub
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at AddServer.main(AddServer.java:8)
    But some times this exception will not appeared.Who can give me answer or suggestion,thanks a lot.
    By the way,when I run shutdown.bat in tomcat_root\bin,I can get some exceptions:
    C:\Tomcat\bin>shutdown
    Using CATALINA_BASE: ..
    Using CATALINA_HOME: ..
    Using CATALINA_TMPDIR: ..\temp
    Using JAVA_HOME: C:\JDK
    Catalina.stop: java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:579)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    I use Windows server 2000+JDK 1.3.1_04+tomcat 4.1.7

    Maybe I am off base here but it seems to me the problem is the way in which you bind your server. The server must be bound to the same address and you are looking up from, i.e. "rmi://" host "/AddServer"
    so
    Naming.rebind("AddServer",addServerImpl);should be
    Naming.rebind("rmi://127.0.0.1/AddServer", addServerImpl);to match
    String addServerURL="rmi://"+args[0]+"/AddServer";
    AddServerIntf addServerIntf=(AddServerIntf)
    Naming.lookup(addServerURL);Hopefully this will solve your problem, if not it is a problem with your classpath. An easy way to make sure it can see your files is to set the java.rmi.server.codebase to point to where your classes are, e.g.
    java -Djava.rmi.server.codebase=file:"c:\\cygwin\\home\\tweak\\keck_folder\\cmsi401\\RMIGalaxySleuth\\classes\\" AddServer
    I had to set the codebas for my rmi stuff to work no matter how much I messed with the classpath.
    Hope this helps,
    Will

  • About apache james

    I know here is not a proper place to ask this question,but I can not find it's forum.
    Where could I get articls about apache james or forum about it.
    Thanks ahead.

    Where could I get articls about apache james http://james.apache.org/
    http://wiki.apache.org/james
    http://www.google.com
    or forumhttp://jakarta.apache.org/site/mail.html
    http://wiki.apache.org/james

  • Off Topic? Apache POI

    I am experimenting with Apache and have
    tried the following with success:
    I hope you don't mind my posting here
    with an Apache question, the Apache site
    seems to be unavailable at the moment, but
    then again, it is still Java.
    Thanks.
        HSSFWorkbook wb = new HSSFWorkbook();
        FileOutputStream fileOut = new FileOutputStream("C:\\workbook.xls");
        wb.write(fileOut);
        fileOut.close();But the following without success (narrowed down to this line I think).
        XSSFWorkbook wb = new XSSFWorkbook();...this error message.
    java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException
    ...tried these imports.
    import org.apache.poi.xssf.usermodel.XSSFWorkbook;
    import org.apache.poi.xssf.usermodel.*;I don't think it's the path because, as stated above, they both
    derive from ss.usermodel.
    Anyone have a suggestion?
    Thanks,
    Jeff.

    jSpence wrote:
    I don't think it's the path because, as stated above, they both
    derive from ss.usermodel.Class not found problems come from two sources
    1. It isn't in the class path
    2. The class failed to load due to some problem (such as an exception from from a static block.) Failures of this sort should generally or always have additional information available via the stack trace.

  • Can I process Excel BIFF5 files, or simply abandon Apache POI?

    To the experienced:
    I am totally new to processing Microsoft Excel files using Java, and embarked on Apache POI. Now it seems I could be completely out of luck because of the Excel files I am to process.
    Now looking back, I realize that what I did with the Excel file I first received (a .xls file) was opening it in Excel 2007 and clicked the Save button. And it was all OK learning POI by processing that file. Now after all the work I have done with that file, I trashed it and got a copy of the original Excel file - as is, without first loading it in Excel 2007 and saving it - and run my java program on it. And I got the following error message talking about BIFF5 and BIFF8:
    C:\Oracle\Middleware\jdk160_18\bin\javaw.exe -client -classpath
    C:\apps11113\JavaExercise\.adf;C:\apps11113\JavaExercise\Basic\classes;C:\java_lib\poi-3.7\poi-3.7-20101029.jar
    -Djavax.net.ssl.trustStore=C:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks learnjava.ExcelTest2
    Exception in thread "main" org.apache.poi.hssf.OldExcelFormatException: The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format.
    POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)
    My program, when put into production, will run on schedule and unattended, and will have to process the file as is. Am I out of luck and have to look for some other APIs that support BIFF5? Are there such APIs?
    Many thanks for helping!
    Newman

    J. Newman wrote:
    Exception in thread "main" org.apache.poi.hssf.OldExcelFormatException: The supplied spreadsheet seems to be Excel 5.0/7.0 (BIFF5) format.
    POI only supports BIFF8 format (from Excel versions 97/2000/XP/2003)
    My program, when put into production, will run on schedule and unattended, and will have to process the file as is. Am I out of luck and have to look for some other APIs that support BIFF5? Are there such APIs?I'm pretty sure that OpenOffice will. One test you could do is try to open your 5.0 file in OpenOffice, save it as an Excel 97/2000 file (+don't+ delete your original :-) ) and check to make sure that everything is working as expected, and then see if your POI program can process that.
    If it works, you could try downloading the OpenOffice SDK. It's also possible that something like jodConverter could do the job for you (it looks a lot easier to use), but you'd need to check their website.
    Winston

  • Questions about your new HP Products? HP Expert Day: January 14th, 2015

    Thank you for coming to Expert Day! The event has now concluded.
    To find out about future events, please visit this page.
    On behalf of the Experts, I would like to thank you for coming to the Forum to connect with us.  We hope you will return to the boards to share your experiences, both good and bad.
     We will be holding more of these Expert Days on different topics in the months to come.  We hope to see you then!
     If you still have questions to ask, feel free to post them on the Forum – we always have experts online to help you out.
    So, what is HP Expert Day?
    Expert Day is an online event when HP employees join our Support Forums to answer questions about your HP products. And it’s FREE.
    Ok, how do I get started?
    It’s easy. Come out to the HP Support Forums, post your question, and wait for a response! We’ll have experts online covering our Notebook boards, Desktop boards, Tablet boards, and Printer and all-in-one boards.
    We’ll also be covering the commercial products on the HP Enterprise Business Community. We’ll have experts online covering select boards on the Printing and Digital Imaging and Desktops and Workstations categories.
    What if I need more information?
    For more information and a complete schedule of previous events, check out this post on the forums.
    Is Expert Day an English-only event?
    No. This time we’ll have experts and volunteers online across the globe, answering questions on the English, Simplified Chinese, and Korean forums. Here’s the information:
    Enterprise Business Forum: January 14th 7:00am to 12:00pm and 6:00pm to 11:00pm Pacific Time
    Korean Forum: January 15th 10am to 6pm Korea Time
    Simplified Chinese Forum: January 15th 10am to 6pm China Time
    Looking forward to seeing you on January 14th!
    I am an HP employee.

    My HP, purchased in June 2012, died on Saturday.  I was working in recently installed Photoshop, walked away from my computer to answer the phone and when I came back the screen was blank.  When I turned it on, I got a Windows Error Recovery message.  The computer was locked and wouldn't let me move the arrow keys up or down and hitting f8 didn't do anything. 
    I'm not happy with HP.  Any suggestions?

  • Have questions about your Creative Cloud or Subscription Membership?

    You can find answers to several questions regarding membership to our subscription services.  Please see Membership troubleshooting | Creative Cloud - http://helpx.adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting- creative-cloud.html for additional information.  You can find information on such topics as:
    I need help completeing my new purchase or upgrade.
    I want to change the credit card on my account.
    I have a question about my membership price or statement charges.
    I want to change my membership: upgrade, renew, or restart.
    I want to cancel my membership.
    How do I access my account information or change update notifications?

    Branching to new discussion.
    Christym16625842 you are welcome to utilize the process listed in Creative Cloud Help | Install, update, or uninstall apps to install and evaluate the applications included with a Creative Cloud Membership.  The software is fully supported on recent Mac computers.  You can find the system requirements for the Creative Cloud at System requirements | Creative Cloud.

  • Questions about using the Voice Memos app

    I'm currently an Android user, but will be getting an iPhone 6 soon. My most used app is the voice memos app on my Android phone. I have a couple questions about the iPhone's built-in voice memos app.
    -Am I able to transfer my voice memos from my Android phone to my iPhone, so my recordings from my Android app will show up in the iPhone's voice memos app?
    -When exporting voice memos from the iPhone to computer, are recordings in MP3 format? If not, what format are they in?
    -In your opinion, how is the recording quality of the voice memos app?

    You cannot import your Android voice memos to your iPhone's voice memo app.  You might be able to play the Android memos and have the iPhone pick up the audio and record it.
    Here is the writeup about sending voice memos from the iPhone to your computer (from the iPhone User Guide):
    App quality is excellent.

Maybe you are looking for