Discussions

Web tier: servlets, JSP, Web frameworks: Converting XML to Excel

  1. Converting XML to Excel (9 messages)

    Hi All!

    Is it possible?

    Any suggestions will be appreciated!

    Mike

    Threaded Messages (9)

  2. Converting XML to Excel[ Go to top ]

    It is possible,
    I think this piece of code will help u to read from Excel SpreadSheet using JDBC-ODBC Driver:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:"+dsn,"","");
    ResultSet rs = stm.executeQuery("Select * from [SheetName$]");

    after obtaining values from rs,these xmldocument can be build using sun or xerces parser

    I hope this would help..
    Nirmal


  3. Converting XML to Excel[ Go to top ]

    I need reverse process. XML to Excel.
  4. Converting XML to Excel[ Go to top ]

    If perl is an option, what you are asking for is doable in perl using XML::Parser(or any of the other XML parsers that are available as perl modules) and OLE perl modules.
  5. Converting XML to Excel[ Go to top ]

    The datas from the XML file can be extracted using SAX / DOM parser and these values could be inserted using SQL Query into EXCEL SpreadSheet using JDBC Driver.In EXCEL SpreadSheet,Sheet is like RDBMS Table and First Row of the Spreadsheet is the Fields in the Table.

    Nirmal
  6. Converting XML to Excel[ Go to top ]

    Why not just take the XML and render it into CSV. Excel can read that just fine.

    Simple, effective, most sites do it this way, and it works.

    If you're serving it over HTTP, just set the mime type to something associated with Excel (It's a long obscure mime type, I can't remember it off the top of my head) but it will cause Excel to pop up direct from the browser.

    Chz

    Tony
  7. Converting XML to Excel[ Go to top ]

    Excel accepts HTML (reduced XML).
    HTML formatted tables ( with extra excel-only attributes )
    are greatly rendered by excel.
  8. Converting XML to Excel[ Go to top ]

    You can merge the XML with an XSL stylesheet that renders your file into a .slk format.

    CSV will work, but you will be limited on formatting. SLK allows to specify headers etc...

    Ive got code if you need.
  9. Converting XML to Excel[ Go to top ]

    I think this xml->slk may be what I've been looking for. I haven't been able to find any information on it on the web or usenet. If you could please point me to the right direction, I will appreciate it greatly. The following is my email, I hope you can cc me your reply as well. Thanks.

    chaudhar at umich dot edu

    Shahbaz C.
  10. Converting XML to Excel[ Go to top ]

    I created an Excel Document that had the same format as what I wanted the XML to be formatted into. I saved the Document as .slk and then opened it with notepad. I took the formatting and used it in my XSL stylesheet. I had dummy data in the Excel sheet and figured out which parts of the SLK were data and which parts were formatting. That allowed me to "plug" in the real data using XPATH expressions in my stylesheet.

    Hope this helps