• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing from Excel Sheet

 
Josweth Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
AS per my requirement I need to print the data from excel sheet using java api (not with AWT and swing).

Thanks &Regards,
Joswetha
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't mind a hackish solution:
  • save the file to be printed to a well-known filename, e.g. "tmp.xls"
  • use the Runtime class to start Excel with a particular file, e.g. "printing.xls"
  • "printing.xls" should contain a macro that opens "tmp.xls" and prints it
  • delete "tmp.xls"


  • Obviously this method has a number of limitations and drawbacks, but it will get the job done.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic