This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Printing from Excel Sheet" Watch "Printing from Excel Sheet" New topic
Author

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,
Joswetha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41029
    
  43
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.


    Ping & DNS - my free Android networking tools app
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Printing from Excel Sheet
     
    Similar Threads
    Copying a sheet from an excel file to another excel file using Apache POI
    create a excel sheet fom java and jsp
    JDBC
    WA #1.....word association
    handling excel sheet with java