KenNichols Posted June 11, 2009 Share Posted June 11, 2009 I need some ideas on how to generate a report. This is how I am doing it now. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $FormEdit = GUICreate("Form1", 738, 713, 192, 124) $EditReport = GUICtrlCreateEdit("", 8, 8, 721, 697, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_HSCROLL,$WS_VSCROLL)) GUICtrlSetData(-1, "Edit") GUICtrlSetBkColor(-1,0xffffff) GUISetState(@SW_SHOW) $ReportLocation = @ScriptDir & "\Report.txt" GUICtrlSetData($EditReport,FileRead($ReportLocation)) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
i542 Posted June 11, 2009 Share Posted June 11, 2009 What are you trying to do? On which subject do you need help on? Please provide enough information so others can help you. I can do signature me. Link to comment Share on other sites More sharing options...
KenNichols Posted June 11, 2009 Author Share Posted June 11, 2009 What are you trying to do? On which subject do you need help on? Please provide enough information so others can help you.I want to generate a viewable/printable report. I use the following code to write to a text file. And I use the code from the first post to display it on the screen. It is not very visually appealing nor easy to read as the columns do not line up. I just want a couple of ideas on how others are displaying/printing reports. $ReportLocation = @ScriptDir & "\Report.txt" $ReportFile = FileOpen($ReportLocation, 1) If $ReportFile = -1 Then MsgBox(0, "Error: Report File", "Unable to open report file.") Exit EndIf $CustomerName = StringLeft($CustName,30) FileWriteLine($ReportFile, $Date & " | " & $CustomerName & " | " & $Model & " | " & $ID & " | " & $Serial & " | " & $Quote & " | " & $CompletedBy) FileClose($ReportFile) [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
KenNichols Posted June 11, 2009 Author Share Posted June 11, 2009 Maybe this will help. When the report is opened whatever text that is in the text file shows up in the edit box. Example- 06/11/2009 | US COAST GUARD | V860 | 1000 | 756423118 | 195.00 | Ken Nichols 06/11/2009 | UNITED METHODIST | TY-450 | 1001 | 96358726 | 195.00 | Ken Nichols This doesn't look very nice. I looked all over and I can't find a good example of how to do this better. [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
Valuater Posted June 11, 2009 Share Posted June 11, 2009 Maybe... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Read the below data in from file $Data1 = "06/11/2009 | US COAST GUARD | V860 | 1000 | 756423118 | 195.00 | Ken Nichols" $Data2 = "06/11/2009 | UNITED METHODIST | TY-450 | 1001 | 96358726 | 195.00 | Ken Nichols" GUICreate("listview", 600) $listview = GUICtrlCreateListView("Promotion Date|Organization|Connection|Speed|Phone Number|Monthly Fee|Sales Person", 10, 10, 580, 150) $item1 = GUICtrlCreateListViewItem($Data1, $listview) $item2 = GUICtrlCreateListViewItem($Data2, $listview) GUISetState() While GUIGetMsg() <> -3 WEnd 8) Link to comment Share on other sites More sharing options...
KenNichols Posted June 12, 2009 Author Share Posted June 12, 2009 Maybe... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Read the below data in from file $Data1 = "06/11/2009 | US COAST GUARD | V860 | 1000 | 756423118 | 195.00 | Ken Nichols" $Data2 = "06/11/2009 | UNITED METHODIST | TY-450 | 1001 | 96358726 | 195.00 | Ken Nichols" GUICreate("listview", 600) $listview = GUICtrlCreateListView("Promotion Date|Organization|Connection|Speed|Phone Number|Monthly Fee|Sales Person", 10, 10, 580, 150) $item1 = GUICtrlCreateListViewItem($Data1, $listview) $item2 = GUICtrlCreateListViewItem($Data2, $listview) GUISetState() While GUIGetMsg() <> -3 WEnd 8)Thanks, that looks much much better! [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
Valuater Posted June 12, 2009 Share Posted June 12, 2009 (edited) I wrote this for a postal worker to track Customers, it displays like the above and has multiple search capabilities and edit any section you wantTake a look........http://www.autoitscript.com/forum/index.ph...st&p=2820678) Edited June 12, 2009 by Valuater Link to comment Share on other sites More sharing options...
KenNichols Posted June 12, 2009 Author Share Posted June 12, 2009 I wrote this for a postal worker to track Customers, it displays like the above and has multiple search capabilities and edit any section you wantTake a look........http://www.autoitscript.com/forum/index.ph...st&p=2820678)This is way more then I expected! Thank you!this will get me headed in the right direction. [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! 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