Results 1 to 15 of 15
  1. #1
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Red face How to Open .odf(calc) File using java on Click event of button

    Hi All,
    I need your help in How to Open .odf(calc) File using java on Click event of button. I am new to java please help me.
    Thanks In advance....

  2. #2
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    319
    Rep Power
    13

    Default

    Hello,

    Are you using OpenOffice.org?
    and do you want to open file in JSP?
    sanjeev,संजीव

  3. #3
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    Hi I am using open office.org

  4. #4
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    Hi sanjeev,
    Thankx for reply I am using open office.org

  5. #5
    nathic is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Hi deshmukh.niraj04,

    have you checked out this site?

    jOpenDocument Homepage. Open Document library

    and here an example:

    jOpenDocument Homepage

  6. #6
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    Thankx for reply.
    But Which library files (API) I need to use for this...

  7. #7
    nathic is offline Member
    Join Date
    Oct 2010
    Posts
    7
    Rep Power
    0

    Default

    Download the binaries from here:

    jOpenDocument Homepage

    and here is the online API:

    jOpenDocument API 1.2b3

  8. #8
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    319
    Rep Power
    13

    Default

    Hello Niraj,

    Please provide some more details:

    Are getting some error while connecting with open office?
    Have you installed OpenOffice?

    below is the example for connecting with OpenOffice using Java

    import ooo.connector.BootstrapSocketConnector;
    public class TestDoc {
    public static void main(String args[]) {

    //com.sun.star.uno.XComponentContext xContext = null;
    String oooExeFolder = "C:/Program Files/OpenOffice.org 3/program/";
    try {
    // get the remote office component context
    //xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
    com.sun.star.uno.XComponentContext xContext = BootstrapSocketConnector.bootstrap(oooExeFolder);
    if( xContext != null )
    System.out.println("Connected to a running office ...");
    }
    catch( Exception e) {
    e.printStackTrace(System.err);
    System.exit(1);
    }
    }
    }
    sanjeev,संजीव

  9. #9
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    Package com.sun.star.uno does not exists

  10. #10
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    319
    Rep Power
    13

    Default

    Install OpenOffice and put the lib\*.jar into your classpath
    sanjeev,संजीव

  11. #11
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    Hi Sanjeev,
    Now i am getting following error package ooo.connector does not exist

  12. #12
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    319
    Rep Power
    13

    Default

    R u running the same example which i have given

    or you can post your code
    sanjeev,संजीव

  13. #13
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    I am trying the same that you hav given...

  14. #14
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    319
    Rep Power
    13

    Default

    can you just post exact error stack trace
    sanjeev,संजीव

  15. #15
    Join Date
    Mar 2011
    Posts
    52
    Rep Power
    0

    Default

    Hi Sanjeev,
    Thankx a lot for your valuable help. Can you tell me how i can open a existing file. that code is working fine and showing connected to running office.
    But how can i select a particular file to open.

Similar Threads

  1. creating a frame on button click event
    By ankit1801 in forum New To Java
    Replies: 8
    Last Post: 03-16-2011, 05:11 AM
  2. How we can open a file with a click in button
    By kostinio in forum AWT / Swing
    Replies: 2
    Last Post: 11-01-2009, 04:46 PM
  3. Swing - catching click button event
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-11-2008, 11:03 PM
  4. AWT - catching click button event
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-11-2008, 11:02 PM
  5. How to perform some event to button click
    By eva in forum AWT / Swing
    Replies: 2
    Last Post: 01-16-2008, 12:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •