Sign in to follow this  
Followers 0
KenNichols

I need some ideas - Generating Reports

8 posts in this topic

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!

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 want

Take a look........

http://www.autoitscript.com/forum/index.ph...st&p=282067

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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 want

Take a look........

http://www.autoitscript.com/forum/index.ph...st&p=282067

8)

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!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0