on 04-17-2007 11:15 AM
Hi,
I'm trying to print a html document into Web Dynpro but for me it's very difficult cause is a dinamically content with a lot of text. So I would like when a push the button print call the keys CTRL+P. It's possible?
Thanks and sorry for my English!
Hi,
Yes it is possible provided you have a printer connected and properly configured. In fact you can do all operations that are availbel to your browser.
Cheers!!!
Sukanta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's possible and how?
This the solution.... One hour after I find the solution.
public void onActionPrint(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionPrintEncuestaPDF(ServerEvent)
try{
Robot robot = new Robot();
//CTRL+P
robot.keyPress(KeyEvent.VK_CONTROL );
robot.keyPress(KeyEvent.VK_P );
robot.keyRelease(KeyEvent.VK_CONTROL );
robot.keyRelease(KeyEvent.VK_P );
//Alt+U
robot.keyPress(KeyEvent.VK_ALT );
robot.keyPress(KeyEvent.VK_U );
robot.keyRelease(KeyEvent.VK_ALT );
robot.keyRelease(KeyEvent.VK_U );
//ENTER
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER );
}
catch(Exception e){ }
}
Thanks
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.