Is it possible?
Any suggestions will be appreciated!
It is possible,
I think this piece of code will help u to read from Excel SpreadSheet using JDBC-ODBC Driver:
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..
I need reverse process. XML to Excel.
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.
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.
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.
Excel accepts HTML (reduced XML).
HTML formatted tables ( with extra excel-only attributes )
are greatly rendered by excel.
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.
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
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