Results 1 to 11 of 11
  1. #1
    nehaa's Avatar
    nehaa is offline Member
    Join Date
    Jan 2009
    Posts
    35
    Rep Power
    0

    Thumbs up [SOLVED] Export to excel

    :(
    I have data in ms-access database.I want to export it to Excel on click of a button which is in front end developed in core java.
    I am working on frames NOT applet.

    I developed a macro in access to export data to excel.
    But i dont know how to run this macro on click of a button in core java application.
    Is it possible to run ms-access macro on click of a button in core java application?

    If not possible kindly suggest some other way.

    Kindly do me a favour in this regard.
    Thanks in advance.
    :)

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    No, it's not possible. You'll have to re-write it in Java. Creating a csv file is the simplest, and will be readable in excel.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    nehaa's Avatar
    nehaa is offline Member
    Join Date
    Jan 2009
    Posts
    35
    Rep Power
    0

    Default Thanks for ur valuable suggestion

    how csv files can be created in core java application taking data from ms-access database???

    however
    Now I have thought to test Jexcel api for creating excel sheets.
    I'm facing the following problem :-

    Project1.java:4211: reference to Font is ambiguous, both class jxl.write.Font in jxl.write and class java.awt.Font in java.awt match


    Project1.java:2472: reference to Label is ambiguous, both class jxl.write.Label in jxl.write and class
    java.awt.Label in java.awt match

    how to solve it????

    thanks for ur consideration
    waiting for reply

  4. #4
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    I mention csv as it's a very simple format - commas separate columns, newlines separate rows.

    You've imported multiple classes with the same name. Either only import the classes you need, or if you need them both you have to use the full name (i.e. jxl.write.Font).
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  5. #5
    nehaa's Avatar
    nehaa is offline Member
    Join Date
    Jan 2009
    Posts
    35
    Rep Power
    0

    Default thanks a lot

    I have no problem using csv files.

    But I am unable to understand how data from ms-accesss can be brought to csv file and then converting this csv file to excel.
    And all this is to be done using core java.

    If you please help me out.

    thanks again
    waiting for your reply

  6. #6
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Use a JDBC driver to connect to the database. Excel will read csv with no problems. If you want to create an .xls or .xlsx you'll need to use an excel java library like that JExcel you found.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  7. #7
    nehaa's Avatar
    nehaa is offline Member
    Join Date
    Jan 2009
    Posts
    35
    Rep Power
    0

    Default thanks a lot

    I am using Jexcel API
    I have created workbook,worksheet........
    But i am unable to set value of cells as Strings.
    I searched for it but only came to know about Number class in JExcel which sets number as cell value.

    But in my database I have many tables having columns of Strings , date etc.

    How to put them in excel Worksheet using Jexcel???

    If you please help me out.

    Thanks a lot

  8. #8
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  9. #9
    nehaa's Avatar
    nehaa is offline Member
    Join Date
    Jan 2009
    Posts
    35
    Rep Power
    0

    Smile Thanks for ur valuable suggestion

    :)My problem is solved

    Thanks a lot for your great help.:)

  10. #10
    nehaa's Avatar
    nehaa is offline Member
    Join Date
    Jan 2009
    Posts
    35
    Rep Power
    0

    Lightbulb how to close thread???

    I tried a lot but couldnot find way to close thread.
    :confused:

    Thanks

  11. #11
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Use Thread Tool at the top of the thread
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. Export to Excel worsheet
    By rosh72851 in forum New To Java
    Replies: 3
    Last Post: 11-13-2008, 02:51 PM
  2. Export to Excel from Dynamic DataTable
    By pathan.umapathi@gmail.com in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 09-26-2008, 10:49 AM
  3. export to excel
    By diana glz in forum Advanced Java
    Replies: 0
    Last Post: 03-13-2008, 11:01 PM
  4. export to excel
    By diana glz in forum New To Java
    Replies: 0
    Last Post: 03-13-2008, 09:26 PM
  5. Export excel issue
    By sanjay_sharma77 in forum Advanced Java
    Replies: 0
    Last Post: 01-10-2008, 03:47 PM

Posting Permissions

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