on 04-17-2007 3:58 PM
Hi, I'm trying to print a html document with this following java code:
public void onActionPrintEncuestaPDF(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 );
Thread.sleep(500);
//Alt+U
robot.keyPress(KeyEvent.VK_ALT );
robot.keyPress(KeyEvent.VK_U );
robot.keyRelease(KeyEvent.VK_ALT );
robot.keyRelease(KeyEvent.VK_U );
Thread.sleep(500);
//entrée
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER );
Thread.sleep(500);
}
catch(Exception e){ }
//@@end
}
But unafortunately doesn't work. Somebody knows what happends?
Thanks!
You can probably try to build a client side application which will control Internet Explorer with your application. I'd say automated testing tools would do the same without programming efforts.
Regards,
Dmitry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabriel,
java.awt.Robot class is a part of AWT package and intended for the client side Java GUI, your Web Dynpro code runs on the server side.
Best regards,
Dmitry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.