Skip to Content

Printing in Web Dynpro, finally

Better late than never…

… Is what I can say when I see the support for printing introduced in Web Dynpro CE.  A quick search tells me that there are 150 odd threads on printing issues alone. Web Dynpro on NW 7.0 had no native support for printing and the community came up with pretty good workarounds (converting to PDF, Java Scripting et. al).

But things are about to change in CE and how!! Today I’ll demonstrate the newly introduced printing support in CE. Ok, enough blah…let’s code 🙂



… Is a new class introduced in the “” package and as the name suggests, it provides a factory for client side printing services.



… Will be based on the following scenario: In our view we have a table and we simply want to print it.  I’ll not go through the steps to build the table, we all know it. Here’s a screenshot of what this table looks like:

Basic table

The table has a toolbar and it has a single button labeled “Print”. No prizes for guessing that on click of this button we will invoke the print service and thereby print this table view. I have created an action Print and in the onActionPrint event handler method I wrote the following code:


//the print method takes a IWDViewController instance as parameter



Once the application is run and the “Print” button on the table is clicked, you can see the framework generated print preview page which in this case looks like

Print Preview

By clicking on the “Print” button on the top of the print preview page, we get to see the good old Windows print dialog.




Let me end…

… By saying that this newly introduced API will make it easier for us, the application developers, to obtain a very basic thing like printing. We no longer have to fight with workarounds. But looking at the API, we cannot print only a selected area of the view. Looking forward to the later SPs.

You must be Logged on to comment or reply to a post.
  • Hi Satyajit,

    Thanks for an informative blog. However if i look at the preview frame to me it appears as if it will print only the visible part of the table which is the first 5-6 rows. Is this how it works or does it print the complete table contents.

    Does it also print the scroolbars. Why i ask this is because i want to understand whether it is a ALT+PRINTSCREEN kind of functionality or it is the actual print functionality.


  • Hi Satyajit,

    A Very good blog finally for the Printing Functionality in Webdynpro.

    Which Version of CE are you using? I have downlaoded the trial version in SDN and couldn't find a Class WdPrintservice.

    - Nagarajan.

  • Hi Satyajit,

    Do we have any new API's for printing the selected area in the screen of webdynpro for java, now in CE7.1 SR5?

    Thanks for your blog, it was useful.

  • Hi...

    this seems to be interesting.

    am not a technical guy. am looking for the similar kind of feature in ABAP.

    not sure whether the sample is for ABAP or JAVA.

    Please enlighten me about this.

    if this sample is Java. can any one suggest how to do this print feature in ABAP.

    Thanks a lot in advance.