Skip to Content
Former Member
Sep 14, 2007 at 01:50 PM

printing in web dynpro via javascript


Hi all

I'm having difficulties adding the functionality to print a report (a table) in web dynpro

What I've done so far:

  • I've created a view with a 'print' button

  • I've linked the print button to a action called 'onActionPrint'

  • I've created a controller context value called 'urlToPrintPage' and linked it to my view's context. The variable is of type string

  • I've created a html page with the following code (printing.html):




<button onclick="window.parent.print()">Print</button>



  • I've copied the printing.html file to MyProject/src/mimes/Components/MyComponent/printing.html (locally and not onto the server since I would think that the printing.html would be deployed as well)

  • Within the 'onActionPrint' method I've placed the following code:


  • From a previous thread which is answered (message id: 3314996) the contributor used the url:


  • I assume that the currentPrintElement would be the same as using the currentContextElement and that setAtrURL would be the same as setUrlToPrintPage in my case?

The file gets deployed to:


I tried to access the file with an absolute url, but no joy (anyways the url looks like a temporary one...)

Could anyone please help to clear my understanding of this printing sollution?