aspose file tools*
The moose likes Java in General and the fly likes How can I save data to Excel file without disrupt the style? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can I save data to Excel file without disrupt the style?" Watch "How can I save data to Excel file without disrupt the style?" New topic
Author

How can I save data to Excel file without disrupt the style?

zooly xue
Greenhorn

Joined: Aug 19, 2003
Posts: 5
In my program,I will read data from a table,and copy it to the system clipboard,then paste them to the Excel file.But when pasting,the data won't
arrange per data per cell,they connect with each others even overcast the column line!How can I solve this problem,and if I will do the same thing on Word,how can I do then?Thank you!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Excel is a database under the covers. Use JDBC to update it. If you do a search on Excel in the JDBC forum you will find lots of discussion about this.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
If you put lines into the clipboard with tabs between cells "a1/ta2" they will paste in nicely. I'm not at my regular machine so I don't have a handy reference, but I onced saved a short article about how to cut and paste between Java Swing UI and Excel. You might google for java, excel and clipboard.
Other thoughts:
* You can use JDBC/ODBC to selecta and insert Excel data like a database.
* You can use a generic COM bridge like Jacob to talk to Excel.
* There is a special COM bridge just for Excel ... who recalls the name?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
zooly xue
Greenhorn

Joined: Aug 19, 2003
Posts: 5
Thank Cindy Glass and Stan James!Since I will only paste the data copy from the table,so using the method "use tab"will be ok,thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I save data to Excel file without disrupt the style?