sriKnight Posted May 3, 2012 Share Posted May 3, 2012 One of my other projects that I need to automate is running certain reports for month end. These are crystal reports that need to be run via our software interface. After doing some easy navigation I will eventually get a popup window to chose the file type that I want to save it as and the file name I wish to give it. the Window ID says this is a combo box but when I try to select a string from that combo box it will not work. As I am still a noob to AutoIT can someone point me in a direction for working with this window? No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
Dasttann777 Posted May 4, 2012 Share Posted May 4, 2012 Can I please see your code? Check out my new site!Current Projects:[list][*]Hunter Console - A Small Gadget[*]HunterPad - Basic Notepad aimed at Programmers[*]Betters UP! - Betting Game[/list] Link to comment Share on other sites More sharing options...
stormbreaker Posted May 4, 2012 Share Posted May 4, 2012 FileSaveDialog() ??? ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
Juvigy Posted May 4, 2012 Share Posted May 4, 2012 It is a Crystal Report window right ? I guess you can try with ControlCLick() Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 (edited) No its not a crystal report window. The report is run inside my software's GUI. I have attached a screen shot of the window I am having trouble navigating though and the window info summery screen. Also, is it possible when saving the file to give it a file name of the current date? Edited May 4, 2012 by sriKnight No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
KaFu Posted May 4, 2012 Share Posted May 4, 2012 Something like this might work... $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "Report_" & @YEAR & "-" & @MON & "-" & @MDAY & ".rpt") ControlClick($hWnd,"","[CLASSNN:Button2]") Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 this gets me 90% there. The Default file type that this report will export as is .rpt. In "ComboBox2" is an option for .pdf. I can figure out a way to get pdf selected prior to saving. No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
KaFu Posted May 4, 2012 Share Posted May 4, 2012 What happens if you just use this? $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "Report_" & @YEAR & "-" & @MON & "-" & @MDAY & ".pdf") ControlClick($hWnd,"","[CLASSNN:Button2]") Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 It still saves it as a .rpt. it would look like 5 4 2012.pdf.rpt No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
KaFu Posted May 4, 2012 Share Posted May 4, 2012 How about this? $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "Report_" & @YEAR & "-" & @MON & "-" & @MDAY & ".pdf") ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "SelectString", "pdf") ControlClick($hWnd,"","[CLASSNN:Button2]") Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 Still dropping it in as a .rpt No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 here is the code as it is so far. Everything works great except the file still saves a .rptWinActivate("CORRIDOR") ;navigates to my desired report(I know its not very clean, but the software is a pain!!) Send("{ALT}r") Sleep(500) Send("{UP 2}") Sleep(500) Send("{RIGHT}") Sleep(500) Send("{UP}") Sleep(500) Send("{ENTER}") WinWaitActive("Work Order WIP Report") ControlClick("Work Order WIP Report", "Print", 3523, "left") WinWaitActive("Report Output WorkInProcess.rpt") WinActivate("Report Output WorkInProcess.rpt") ;kicks off an export from the GUI Send("{DOWN 2}") Sleep(500) Send("{ENTER}") WinWaitActive("Export Report") WinActivate("Export Report") ;saves the file $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "Report_" & @YEAR & "-" & @MON & "-" & @MDAY) ;for these three lines I am able to see the dropdown show and then hide, but it still will not select pdf as a file type. ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "ShowDropDown", "") ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "SelectString", 'PDF(*.pdf)') ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "HideDropDown", "") ControlClick($hWnd,"","[CLASSNN:Button1]") WinActivate("Export Report", "Export completed.") WinWaitActive("Export Report") No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
KaFu Posted May 4, 2012 Share Posted May 4, 2012 There seems to be a space missing between PDF and the bracket. ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "SelectString", 'PDF (*.pdf)') Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 I noticed that as I have been trying different combinations of commands and that has had no effect. No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
sriKnight Posted May 4, 2012 Author Share Posted May 4, 2012 Here is my script as it stands right now. All is resolved minus this setting the file type issue. expandcollapse popupWinActivate("CORRIDOR") ;;navigates to first report (WIP)(I know its not very clean, but the software is a pain!!) Send("{ALT}r") Sleep(500) Send("{UP 2}") Sleep(500) Send("{RIGHT}") Sleep(500) Send("{UP}") Sleep(500) Send("{ENTER}") WinWaitActive("Work Order WIP Report") ControlClick("Work Order WIP Report", "Print", 3523, "left") WinWaitActive("Report Output WorkInProcess.rpt") WinActivate("Report Output WorkInProcess.rpt") ;kicks off an export from the GUI Send("{DOWN 2}") Sleep(500) Send("{ENTER}") WinWaitActive("Export Report") WinActivate("Export Report") ;saves the file $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "TJCWIP" & @YEAR & "-" & @MON & "-" & @MDAY) ;for these three lines I am able to see the dropdown show and then hide, but it still will not select pdf as a file type. ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "ShowDropDown", "") ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "SelectString", 'PDF (.pdf)') ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "HideDropDown", "") ControlClick($hWnd,"","[CLASSNN:Button1]") WinActivate("Export Report", "Export completed.") WinWaitActive("Export Report") ControlClick("Export Report", "OK", 2, "left") WinActivate("CORRIDOR") ;Navigate to next report to be run from the schema (WO Invoice Register) Send("{ALT}r") Sleep(500) Send("{UP 2}") Sleep(500) Send("{RIGHT}") Sleep(500) send("{DOWN 9}") sleep(500) send("{Enter}") ;wait for the date paramter field to apear WinWaitActive("Work Order Invoice Register Report") WinActivate("Work Order Invoice Register Report") ControlClick("Work Order Invoice Register Report", "From:", 13308, "left") ;sets the first date paramter to the first day of the month send("{Space}") sleep(500) send("{RIGHT}") sleep(500) send(@Mon) sleep(500) send("{RIGHT}") sleep(500) send("01") sleep(500) ;sets the second date paramter to the currect date that the reprots are being run. send("{TAB}") sleep(500) send("{Space}") sleep(500) send("{RIGHT}") sleep(500) send(@Mon) sleep(500) send("{RIGHT}") sleep(500) send(@Mday) sleep(500) sleep(500) send("{TAB}") ;kicks off the export to file ControlClick("Work Order Invoice Register Report", "Print", 3523, "left") WinWaitActive("Report Output WorkOrderInvoiceRegister.rpt") WinActivate("Report Output WorkOrderInvoiceRegister.rpt") send("{DOWN 2}") sleep(500) send("{ENTER}") ;saves the file $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "TJC WO Invoice REG_" & @YEAR & "-" & @MON & "-" & @MDAY) ;for these three lines I am able to see the dropdown show and then hide, but it still will not select pdf as a file type. ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "ShowDropDown", "") ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "SelectString", 'PDF (.pdf)') ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "HideDropDown", "") ControlClick($hWnd,"","[CLASSNN:Button1]") WinActivate("Export Report", "Export completed.") WinWaitActive("Export Report") ControlClick("Export Report", "OK", 2, "left") sleep(500) WinActivate("CORRIDOR") Send("!r") Sleep(500) Send("{UP 5}") Sleep(500) Send("{RIGHT}") Sleep(500) send("{UP}") sleep(500) send("{Enter}") ;wait for the date paramter field to apear WinWaitActive("Invoice Register Report") WinActivate("Invoice Register Report") ControlClick("Invoice Register Report", "From:", 12103, "left") ;sets the first date paramter to the first day of the month send("{Space}") sleep(500) send("{RIGHT}") sleep(500) send(@Mon) sleep(500) send("{RIGHT}") sleep(500) send("01") sleep(500) ;sets the second date paramter to the currect date that the reprots are being run. send("{TAB}") sleep(500) send("{Space}") sleep(500) send("{RIGHT}") sleep(500) send(@Mon) sleep(500) send("{RIGHT}") sleep(500) send(@Mday) sleep(500) sleep(500) send("{TAB}") ;kicks off the export to file ControlClick("Invoice Register Report", "Print", 1983, "left") WinWaitActive("Report Output SalesOrderInvoiceRegister.rpt") WinActivate("Report Output SalesOrderInvoiceRegister.rpt") send("{DOWN 2}") sleep(500) send("{ENTER}") ;saves the file $hWnd = WinWait("Export Report", "") ControlSetText($hWnd, "", "[CLASSNN:Edit1]", "TJC SO Invoice REG_" & @YEAR & "-" & @MON & "-" & @MDAY) ;for these three lines I am able to see the dropdown show and then hide, but it still will not select pdf as a file type. ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "ShowDropDown", "") ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "SelectString", 'PDF (.pdf)') ControlCommand($hWnd, "", "[CLASSNN:ComboBox2]", "HideDropDown", "") ControlClick($hWnd,"","[CLASSNN:Button1]") WinActivate("Export Report", "Export completed.") WinWaitActive("Export Report") ControlClick("Export Report", "OK", 2, "left") No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now