cancel
Showing results for 
Search instead for 
Did you mean: 

Print the iview

Former Member
0 Kudos

Hi friends...

Yesterday i learned more in SDN...

How to Print the Iview as Button click(onClick)..This button is in view

Please tel me...This is correct or not....

1.Html.html(add mimes)

<html>

<head />

<body onLoad="window.parent.focus(); window.parent.print();">

</body>

</html>

I tried this code but it print blank page...

I want print the content of iview....

If not do ,how to change code to Javascript...

<b>Please send me the steps....</b>

Thanks & regards

Mathi s

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

It seams to me that you might be printing something else than the iview you want to print.

It's hard to figure out if to use parent.focus() or window.parent.focus() or any thing else.

I usually look at the rendered page with developer toolbar (DevToolBar). In the DOM tree it's much easier to figure out the relation between the print html-page and it's parent iview that you want to print.

You can also use a javascript debugger to try out witch combination of parent's you would need to use.

It all depends on the relation between the print html-page and the page you want to print.

Regards, Mikael.

Former Member
0 Kudos

Hi,

Their is no direct way of implementing print functinality in WebDynpro.

You can use Adobe Forms as explained in the following link

http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/frameset.htm

Former Member
0 Kudos

Hi,

How i change this code to java script...

<html>

<head />

<body onLoad="window.parent.focus(); window.parent.print();">

</body>

</html>

PleaseTel Me.... I will try to java script...

Thanks & regards

Mathi

Former Member
0 Kudos

Hi,

Have a look at the thread

Former Member
0 Kudos

Hi Mathi,

Try with this.

In the view insert Button UI element , onAction event Property Just write

javascript:window.print();

This should work.

Rgds

SS

Former Member
0 Kudos

Hi,

Check this also,

1. Create HTML file within mimes folder below sub-folder with name of your component, name it for example print.html

2. Put the following inside HTML:

<html>

<head></head>

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

</html>

3. Put IFrame control on view, set url to print.html and adjust size as necessary

Check this thread for clear reference,

Former Member
0 Kudos

Hi,

Check the below thread, in that for print button code is available...

May b it vl useful,