cancel
Showing results for 
Search instead for 
Did you mean: 

In WebDynpro ,How to add the print function in a view ?

Former Member
0 Kudos

Hello! everyone,

I have one task in protal,

There are 2 views in my webdynpro project, the 1st view are list name items. when I click the name link will open the 2nd view , the 2nd view is a detail view page for each name, now , I want print the 2nd view, how to come out this function ?

can you help me ,thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

siddharth_jain
Active Contributor
0 Kudos

Hi,

Check the following links ,You can find various solution in the below mentioned links for Print functionality in WD

Regards,

Siddharth

Former Member
0 Kudos

thanks a lot everyone ,

This link is my test view

http://www.anydesign.cn/UpFile/UpAttachment/2008-8/2008825174444.jpg

and what code I fill in onActionToPrint ?


public void onActionToPrint(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionToPrint(ServerEvent)
   what ????	
    //@@end
  }

I want print this view only,

I am a sap abecedarian ,thanks!

Edited by: Doke on Aug 25, 2008 11:48 AM

Former Member
0 Kudos

Hi,

Are you using the CE version? If yes you can try it.

Best regards

Former Member
0 Kudos

hi!

this is our computer version message :

<<<<<<<<<<

SAP NetWeaver Developer Studio

Version: 7.0.11

Build id: 200701062019

(c) Copyright SAP AG 2007. All rights reserved.

Visit http://www.sap.com

This product includes software developed by the

Apache Software Foundation http://www.apache.org/

Eclipse.org http://www.eclipse.org/

<<<<<<<<

if I can direct print ?

about to your reply content , I will try to test ,

btw ,

If your have better method give me ,

then you can share.

thanks!

sureshmandalapu6
Active Contributor
0 Kudos

Hi Doke,

My advise is to either:

1. Create Adobe PDF for user to download and print

2. Create printer-friendly HTML and open it in external window

3. Create MS Excel file to download.

First and third options are well documented in SDN docs / tutorials, the second option is very easy to implement: take my code for transforming context tree to XML and apply necessary XSLT template. This way you may get HTML output in printer friendly form.

You can set the printing option in the portal once you have developed the IView.

refer the link

http://help.sap.com/saphelp_nw70/helpdata/EN/8b/fb7bb9ce3e4fdd99be06b11f0b9b0f/frameset.htm

Thanks

Suresh

Former Member
0 Kudos

hi!

I want like this effect in a view , when click a button can print,

this is the method in web page.

"<< a href= "javascript : window . print();" >> print << /a >> "

how to do this in webdynpro ?

can you help me ?

Former Member
0 Kudos

Hi,

As java scripts are not supported in webdynpro, this will not be possible.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Doke,

If i have understood correctly , you want the iview to be printed correctly . Kindly make use of the Print Button which is available in the in NWDS . ( 7.0.0 had the print button which is not there in 7.0.10)

or you can place a HTML file which has got the javascript inbuild print function inside the HTML file, place the HTML file inside the component only. on click of a button you can call the HTML file residing inside the component.

String Url=WDURLGenerator.getWebResourceURL(wdComponentAPI.getDeployableObjectPart(),"print.html");

// Get the html file containing javascript to print window

Now you can open using the URL in a new window or call another window.

Regards

Pankaj Prasoon