on 08-19-2005 8:06 AM
Dear All,
Has any one any suggestions on this one... we are trying to automate the printing of documents from B1. For example we are importing an xml file to create a delivery and we would like the delivery to be printed immediately, or we want to release production orders and then print the production orders.
At present it doesnt seem possible to automate this via DI or UI api. Theres nothing in the DI from what weve seen that can support this. We also tried to automate the document printing via UI using command 'SBOApplication1.ActivateMenuItem("520")', it will bring up a Printing option dialog box, but we can't manage to simulate the press of 'OK' button on this dialog box, so it can't be automated without user intervention.
Has anyone encountered this type of problem or found a way to solve this problem.
Thanks in advance.
Dave
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alexey
Good point... bit still has not helped..
Ok.. we have tested now... and tried the printing with statements below, but it didn't work, got the error message 'The process failed: System.InvalidOperationException:
SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method'.
Also tried SendKeys.SendWait method, then it stops to wait the user click, so also no use.
I believe the examples in SDN is for VB6 code, we are using .NET.
System.Windows.Forms.SendKeys.Send("{TAB 2}")
System.Windows.Forms.SendKeys.Send("{ENTER 2}")
SBOApplication1.ActivateMenuItem("520")
System.Windows.Forms.SendKeys.Send("")
System.Windows.Forms.SendKeys.Send("")
Any ideas ?
Thanks
Dave
Alexey
Good point... bit still has not helped..
Ok.. we have tested now... and tried the printing with statements below, but it didn't work, got the error message 'The process failed: System.InvalidOperationException:
SendKeys cannot run inside this application because the application is not handling Windows messages. Either change the application to handle messages, or use the SendKeys.SendWait method'.
Also tried SendKeys.SendWait method, then it stops to wait the user click, so also no use.
I believe the examples in SDN is for VB6 code, we are using .NET.
System.Windows.Forms.SendKeys.Send("{TAB 2}")
System.Windows.Forms.SendKeys.Send("{ENTER 2}")
SBOApplication1.ActivateMenuItem("520")
System.Windows.Forms.SendKeys.Send("")
System.Windows.Forms.SendKeys.Send("")
Any ideas ?
Thanks
Dave
Ad..
Changed to use the SBO sendkeys method, the error message is no more appearing, but it still doesn't work.
The application just wait when the print window appears until user clicks either 'Print/Cancel' button, the the next statement (SendKeys) will run, it won't pass the print window and run the following SendKeys statements.
SBOApplication1.SendKeys("{TAB 100}")
SBOApplication1.SendKeys("{ENTER 100}")
SBOApplication1.ActivateMenuItem("520")
SBOApplication1.SendKeys("")
SBOApplication1.SendKeys("")
We are still hunting ?
Dave
Dear All
It appears we are struggling controlling the windows dialogue box. Control of business one seems to be ok, but once the windows print box is open, we cant control the send key of the 'Enter' to this window.
Has any one experienced this and/or found a solution.
SBOApplication1.SendKeys("{ENTER 100}")
SBOApplication1.ActivateMenuItem("520")
System.Windows.Forms.SendKeys.Send("")
Thanks
Dave
Hello D. Maton,
Are you talking about the window call "Print Preferences", that comes after you choose print. This gives you the option to choose what you want to print, Window or Table? If so, I have tries many ways to bypass the screen but no success. It's not a SAP form. I see your point to code the System.window.sendkey, but we are doing something wrong. Have you found any luck in solving this or can we work together to bypass this window?
Thanks,
L
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.