Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
zooly xue
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
zooly xue
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic