Skip to Content
author's profile photo Former Member
Former Member

Problem with Printing

Hi,

I am having problem in printing a file from webdynpro.

My code gives java.awt.HeadlessException

PrinterJob job = PrinterJob.getPrinterJob();
PrintRequestAttributeSet prnReqAttrSet = new HashPrintRequestAttributeSet();
job.pageDialog(prnReqAttrSet);

But the same works fine as standalone Java application. But when I run it in the WAS, I get HeadlessException. Can someone help me rectify this issue?

Regards,

Harini S

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 22, 2007 at 11:24 AM

    The reason stands the same. WD applcations are executed in WAS and nothing happens at client side so WD framework doesnot allow you to get that print dialog box

    Add a comment
    10|10000 characters needed characters exceeded

    • The java.awt.HeadlessException is "Thrown when code that is dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse." Serverside you won't be able to display some print dialog on the client anyway. The "trick" is to discover and use the print services directly, without any UI. Of course, all files will be printed on (a printer connected to) the server.

      Kind regards,

      Sigiswald

  • author's profile photo Former Member
    Former Member
    Posted on Mar 22, 2007 at 11:15 AM

    Hi,

    Are you using this code in your WD application ???

    If yes then it won't work as the WD code is executed at the server side and not at the client side.

    Mahesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2008 at 09:44 AM

    Nothing worked. Print Functionality is postponed. So will work later.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.