Excel from Java

Hi ,
could any one help me in creating two excel worksheets from Java.
I know using <%@ page contentType = "application/vnd.ms-excel" %> it will create workbook and reads data from html table .
But I want the data from 2 html tables into 2 excel work sheets with in the same work book ..
Thanks in Advance.

Maybe Jakarta's POI can help you out.

Similar Messages

  • Report in excel from java

    I'm generating report in Excel from Java.In this is it posssible to place background color upto the text in the single cell

    If you are using POI, you can set the background colour for a single cell.

  • Accessing excel from java code

    Hello
    our system uses reportNet to generate reports. When reports are generated in CSV format we have a problem:
    Report consists of people (can be more than one) so under name column we have same name in more than one row. BUT if more than one name is suppose to be in the CSV report then the header (column names row) is again printed.
    so for example if i requested rpeort for two names A and B (reportNet uses same template which is executed twice) then report will look like this
    Name (header - column name)
    A
    A
    A
    A
    A
    Name (header - column name)
    B
    B
    B
    B
    I want to be able to remove the second header that comes before B starts.
    so i was thinking i would be able to access this excel sheet from java. and keep record of every row. If the row changes from A to B...i delete the previous row (which would end up being the second header).
    Can this be done thru java. I havnt before accessed excel sheets from java so any pointers would be greatly appreciated.

    Hi, well CSV is not currently an Excel file, it is a Comma Separated Values
    file which can be read through Excel.
    Now, if you wish to remove the header, I would purpose that you develop an
    application that reads the CSV file, as it is mere text, and that it also reads
    another file (lets call it confirguration.txt) in which you determine the pattern
    you want to remove, then you just read your report and if a string line
    matches the pattern you defined in the configuration.txt file, then you simply
    erase it.
    And if you keep interested in reading real Excel files (xls), I would
    recommend you use POI-HSSF API from Apache.org
    http://jakarta.apache.org/poi/hssf/index.html
    Hope this helps, cya around.

  • Excel from JAVA or C++ --  Urgent -- help

    Hi
    I know it might not be possible, but i want to use couple of Financial Functions which excel provides within itself.
    Is there anyway i can use them from my JAVA or C++ code ?
    In short, would it be possible to call excel functions from JAVA or C++ code
    TIA
    Vikram

    Actually you can... In quite a few different ways. You can access any COM or OLE object in windows from within java by using the Java/COm bridge, or purchasing shrink wrapped products... The links are below:
    These people provide some very cool solutions for java. This link is specifically for excel.
    http://www.intrinsyc.com/pdfs/java-excel_bridge.pdf
    Some Resources for Java/COM...
    http://users.rcn.com/danadler/javacom/

  • Reading Excel from Java

    Hello,
    I would want to read excel data from Java. I do not want to register any excel drivers as I will not be able to know the file to be read before hand. Are there any better ways to solve this ?
    Thanks in Advance,
    Prasanna

    hi prasanna
    if you are using jdbc-odbc bridge I would recommend you to test the
    program with excel files with varying sizes like 3,5, 12, 20 etc. There
    is a some problem with the driver that it chops off some data.
    For example if you have 20k excel file the driver may read in 9k chunks so you get 18k of data read and the driver ignores rest 2k.
    Make sure of that it works on all sizes of input data.
    bib/-

  • Using word/excel from java (client or weblogic server)

    Hi everybody,
    i want to use excel / word functionality from java in two different variants:
    -> serverside
    -> clientside
    I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
    My knowlege about COM is rather bad.
    Does anybody did this bevor and
    -> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
    -> has a example for using Excel / Word from Java in bea weblogic
    -> has a example for using Excel / Word directly in a client (not via rmi)
    Thanks
    Ciao
    Sven

    Sven, This is a really bad idea. Why don't you tell me
    what your trying to do and I wil surely give you a better alternative
    JRadecki
    "Sven Roesner" <[email protected]> wrote:
    >
    Hi everybody,
    i want to use excel / word functionality from java in two different variants:
    -> serverside
    -> clientside
    I tried the weblogic.comc and i got serveral classes but in the remote-package i got only a utitlity-class.
    My knowlege about COM is rather bad.
    Does anybody did this bevor and
    -> can say me, if it is correct, that i only got a utility-class (so how will i use it from the client ?!)
    -> has a example for using Excel / Word from Java in bea weblogic
    -> has a example for using Excel / Word directly in a client (not via rmi)
    Thanks
    Ciao
    Sven

  • Invoking MS Excel from Java

    HI,
    I'm trying to create a standalone application that would need to logon in a database.If the user is a valid one, the user can then choose which table he wanted to update. All the rows of the column will be shown in an excel format. (the program will invoke Excel to show all the records in that table). From that, the user can edit the content and after saving it, data in the databse will also be updated.
    Is there any Java API that I can use to make this application possible?
    Thanks,

    Crossposted: http://forum.java.sun.com/thread.jspa?threadID=678912
    Please don't answer on this duplicate copy.
    And @OP: QUIT IT!

  • Generate the Chart in Excel from Java

    Hi All,
    I have a typical problem that is I want to generate the
    Excel charts through Java coding dynamically . Now Iam able to
    create a excel sheet and populating the Data in that,but Iam not
    able and not even have the Idea how to generate the Chart with
    the popuated data , please can any body suggest me ...with the
    code snippet ( iam using the jxl 2.4.2 jar ) .
    Thanks in Advance

    Still Looking forward for the reply...Pls Help meGod, what a loser, to wait for 7 days for what I could find in less that 7 minutes on Google. And I'd never even heard of jxl.jar.
    Incidentally -- what do you think this has to do with Swing, that you posted it here in the Swing forum?
    db

  • Programming Excel from Java

    How can I copy an EXCEL file from a NT machine to a Unix machine and then present it on client's workstation, when the application server is in Unix. Please think of a situation wherein the EXCEL file got created on NT Server, the application server is installed on a Unix, web application is a Servlet running in Unix and the User initiates a request from a browser.
    can someone please help. this is urgent for us.

    Can you please help by elaborating a little further?Yes - but SEARCH THE FORUMS, similar questions:
    "how do I send an image the browser"
    "how do I send a pdf the browser"
    "how do I send a word/doc the browser"
    set the mime type appropriately in the http response
    write your byte stream to the http response output stream

  • Export tableview data to pdf or excel from java

    Hi
      How do i Convert tableview data generated using defulttableviewmodel to pdf excel format. Any APIs are their ?
    Regards
    Ganesan

    Hi Ganesan,
    Check these blogs on pdf and excel APIs.
    <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1468">PDF API</a>
    <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1390">Excel  API</a>
    Hope it helps.
    Regards,
    Saravanan

  • How to display UTF - 8 when genereate excel from java

    I use Jsp to input chinese words as UTF-8, and store them to Oracle. When I display these words in Jsp, there is nothing wrong. But if I generate Excel through servlet, these words display as "???e????", how can I resolve this problem?
    Thank you!!!

    What library are you using to generate xls files? Then find that library's support fora.

  • Background color in POI (Excel report from java)

    I'm generating report in Excel from Java.how can background color is set for single cell.

    i write code like
    style.setFillBackgroundColor(HSSFCellStyle.RED);
    it shows error that can not resolve symbol variable RED.why?give me solution

  • Integrating Excel with Java

    Hi,
    How can Excel be integrated with Java such that if a user is working on an Excel , my Java application should be able to capture all the events from Excel Sheet.
    I have looked into POI, but it seems to me , it can read and wriite to Excel from Java, but i would like that if a user is making changes to a spredsheet then my Java Application should be notified about those changes
    In short, i would like to expose front end of a web application in Execl!
    Is there any open source package that can help in doing the integration
    Kindly share your views/ suggestions

    jschell wrote:
    If you just want most of what is occuring in Excel only then there are probably events in the Excel API (OLE >probably) that allow you to modify and react to changes. In my experience figuring out how to do that is very >difficult even for small bits of functionality.Can u please explain a little more on this.
    Can i use JNI to listen to COM server, probaly if i create some proxies for Excel that use JNI to listen to COM Server.
    I found a link on the internet http://www.ibm.com/developerworks/java/library/j-bridge/
    This Java bridge can integrate COM objects into their applications. But i am not sure if i can capture the live stuff from an Excel file when somebody is editing it.
    Also i would like to know, what should be the best stratergy when i would like to expose the Front end of an application in Excel , since the application involves a lot of numbers and users are more comfortable with Excel interface, and the rest of the application you want in Java.
    Kindly share your views on this!

  • Writing data from Java to Excel

    Hi,
    I am trying to writhe data from Java to an Excel Sheet by using JACOB.
    This is my code :
    import java.util.*;
    import java.io.*;
    //import cost.util.*;
    import com.jacob.com.*;
    import com.jacob.activeX.*;
    class XLStock
         public static void main(String argv[])
              XLStock xls = new XLStock();
              xls.main2(argv);
         public void main2(String argv[])
              System.setSecurityManager(null);
              System.runFinalizersOnExit(true);
              Vector v = new Vector();
              XLSPutItem pi;
              String sheetfile = null;
              ActiveXComponent xl;
              Object xlo=null;
              Object workbooks;
              Object workbook;
              Object sheets;
              Variant vOptn = new Variant();
              vOptn.noParam();
              try
                   xl = new ActiveXComponent("Excel.Application");
                   xlo = xl.getObject();
                   Dispatch.put(xlo, "Visible", new Variant(true));
                   xl.setProperty("Visible", new Variant(true));
                   workbooks = xl.getProperty("Workbooks").toDispatch();
                   Variant vTemp = new Variant(argv[0]);
                   workbook = Dispatch.invoke(workbooks, "Open", Dispatch.Method,
                        new Variant[] {vTemp, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn, vOptn},
                        new int[1]).toDispatch();
                   sheets = Dispatch.get(workbook,"Sheets").toDispatch();
                   pi = new XLSPutItem();
                   if (pi.Parse("1:A1;ciao;6"))
                        v.addElement(pi);
                   for (int i=0; i<v.size(); i++)
                        pi = (XLSPutItem)v.elementAt(i);
                        pi.sheet = Dispatch.invoke(sheets, "Item", Dispatch.Get, new Object[] {new Variant(pi.sheetNumber)}, new int[1]).toDispatch();
                        pi.cell = Dispatch.invoke(pi.sheet, "Range", Dispatch.Get, new Object[] {pi.cellName}, new int[1]).toDispatch();
              catch (Exception e)
                   e.printStackTrace();
              pi = (XLSPutItem)v.firstElement();
              Dispatch.put(pi.cell, "Value", "ciao");
    What happen is that my code always fail at this line :
    xl = new ActiveXComponent("Excel.Application");
    whit this error :
    C:\VJWorks\JNI\jxls>java jxls.XLStock
    com.jacob.com.ComFailException: Can't co-create object
    at com.jacob.com.Dispatch.createInstance(Native Method)
    at com.jacob.com.Dispatch.<init>(Dispatch.java)
    at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java)
    at jxls.XLStock.main2(XLStock.java:53)
    at jxls.XLStock.main(XLStock.java:28)
    Exception in thread "main" java.util.NoSuchElementException
    at java.util.Vector.firstElement(Vector.java:450)
    at jxls.XLStock.main2(XLStock.java:79)
    at jxls.XLStock.main(XLStock.java:28)
    I task that something is wrong in my system configuration.
    I work on a Win2000 platform and Office 97.
    Someone knows the reason of this error and can suggest what to make.
    Thanks in advance.
    Antonio M.

    Antonio, maybe you can post this back to the Jacob list. As an alternative to Jacob, what about Apache POI or writing the data as comma-delimited and opening the file using Runtime?
    Hope that may help.
    Good luck.

  • Excel report from java

    I'm generating the Excel report from java .In that i create a row,but i don't know how to increase the size of the cell.if any one have idea.kindly suggest it

    I had a similar porblem and finally i guess somebody can help me with this issue
    I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
    This is my code in servlet...
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet spreadSheet = wb.createSheet("Users");
    spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
    spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
    // Creating Rows
    HSSFRow row = spreadSheet.createRow(0);
    HSSFCell cell = row.createCell((short) 1);
    cell.setCellValue("Year 2005");
    cell = row.createCell((short) 2);
    cell.setCellValue("Year 2004");
    HSSFRow row1 = spreadSheet.createRow(1);
    HSSFCellStyle cellStyle = wb.createCellStyle();
    cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
    cell = row1.createCell((short) 0);
    cell.setCellValue("Revenue ($)");
    cell = row1.createCell((short) 1);
    cell.setCellValue("25656");
    cell = row1.createCell((short) 2);
    cell.setCellValue("15457");
    FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
    ServletOutputStream out = response.getOutputStream();
    wb.write(output);
    output.flush();
    output.close();
    forward = null;
    In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......Bottom line is onclick of a link in jsp it should open up a ezcell report....
    Please please please help me....
    Thanks in advance...

Maybe you are looking for

  • How do I print more than one 4X6 on a page?

    How do you print more than one 4X6 on a page?

  • Creating a PO using OREDERS05 IDOC

    Hi All, I need to create a PO using the OREDRS05 Idoc, insted of that a standard SO is getting created as I am using ORDE process code. I dnt find any process code for creating a PO related to ORDERS05. Is there any process code for creating a PO or

  • Can't Open jpeg files from Bridge CS3 to PhotoShop CS3

    This is really weird. I had a trial version of CS3 and bridge worked fine. That ran out, so I tried CS2 to see if I could get by with the older version. CS2's bridge worked just fine. Then I installed a full version copy of CS3 and removed CS2 (to fr

  • Checklists in Oracle HRMS R12

    Hi All, I'm Using Checklists in Oracle HRMS R12. When I am trying to create a life event reason(Total compensation-->general definitions-->additional setup) I'm not able to select the Person Changes and Related Person Changes tabs as they are being s

  • Fireworks to Edge Reflow?

    I know Adobe don't like Fireworks but I'm hoping that they will have a workflow from FW6 to Edge Reflow. Is there any info on this? Photoshop is great for image editing but it sucks real hard for web and mobile design, I just can't use it for that so