File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Printing from Excel Sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Printing from Excel Sheet" Watch "Printing from Excel Sheet" New topic

Printing from Excel Sheet

Josweth Reddy
Ranch Hand

Joined: Nov 02, 2005
Posts: 30
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,
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
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.
    I agree. Here's the link:
    subject: Printing from Excel Sheet
    It's not a secret anymore!