Using the Form Designer, you can create a dashboard to show graphs and list key figures for your company. This tutorial requires the AP Module.
This tutorial will show you how to display an analysis of expenses for a range of periods.
No. |
Name |
Display Label |
Type |
Domain |
Size |
Width |
Visible |
1 |
AnalysisCode |
Expenses |
String |
Analysis Code |
8 |
15 |
Selected |
2 |
AnalysisName |
Analysis Name |
String |
Analysis Name |
60 |
25 |
Selected |
3 |
PeriodBalance |
Period Balance |
Float |
Amount |
|
15 |
Selected |
4 |
YrToDateBalance |
YTD Balance |
Float |
Amount |
|
15 |
Selected |
5 |
LastYRBalance |
LY Balance |
Float |
Amount |
|
10 |
Selected |
6 |
GLAccountCode |
Account Code |
String |
GL Account Code |
8 |
15 |
Clear |
7 |
AccountClass |
Account Class |
String |
Description |
60 |
28 |
Clear |
Property |
Value |
Description |
Height |
270 |
Sets the grid height. You can also drag to change the height. |
Left |
25 |
Moves the grid to the left of the form. |
Top |
30 |
Sets the grid position from the top. You can also drag to change the position. |
Width |
550 |
Sets the grid width. You can also drag to change the width. |
Property |
Value |
Description |
Height |
270 |
Sets the navigator height. You can also drag to change the height. |
Left |
0 |
Moves the navigator to the left of the form. |
Top |
30 |
Sets the grid position from the top. You can also drag to change the position. |
Visible Buttons |
ebOpen ebPrint ebFilterSort ebCustomise |
Select the buttons to show on the grid navigator. Set the buttons listed to True, all others to False. |
Width |
25 |
Sets the grid width. You can also drag to change the width. |
You can now write the MaxBasic code to populate the Memory Table and graph.
Sub RefreshExpenses
Dim tblExpenses as Object
SQLExpenses = "SELECT APANL.AnalysisCode as AnalysisCode" & _
" ,APANL.AnalysisName as AnalysisName " & _
" ,APANL.CurrentPeriodBalance as PeriodBalance " & _
" ,APANL.LastYearBalance as LastYRBalance " & _
" ,APANL.YearToDateBalance as YRToDateBalance " & _
" ,APANL.GLAccountCode as AccountCode " & _
" ,APANL.AccountClass as Class " & _
"FROM APANL " & _
"Order By AnalysisCode"
tblExpenses = ExecuteSQL(SQLExpenses)
tblGraphExp.empty
tblGraphExp.AllowInsertDelete = True
tblExpenses.First
Do Until tblExpenses.EOF
tblGraphExp.Append
tblGraphExp.AnalysisCode = tblExpenses.AnalysisCode
tblGraphExp.AnalysisName = tblExpenses.AnalysisName
tblGraphExp.PeriodBalance = tblExpenses.PeriodBalance
tblGraphExp.LastYRBalance = tblExpenses.LastYRBalance
tblGraphExp.YRToDateBalance = tblExpenses.YRToDateBalance
tblGraphExp.GLAccountCode = tblExpenses.AccountCode
If tblExpenses.Class = "A" Then
tblGraphExp.AccountClass = "Asset"
ElseIf tblExpenses.Class = "C" Then
tblGraphExp.AccountClass = "Capital"
ElseIf tblExpenses.Class = "E" Then
tblGraphExp.AccountClass = "Expenses"
ElseIf tblExpenses.Class = "I" Then
tblGraphExp.AccountClass = "Income"
ElseIf tblExpenses.Class = "L" Then
tblGraphExp.AccountClass = "Liability"
End If
tblGraphExp.Save
tblExpenses.Next
Loop
tblGraphExp.AllowInsertDelete = False
tblGraphExp.First
End Sub
Sub OnCreate
RefreshExpenses
End Sub
Sub OnNavExp(Sender as Object, Button as Number, ByRef Handled as Boolean)
Dim Report as Object
If Button = ebOpen Then
Dim Form1 as Object
Form1 = CreateObject("Accredo.APExpenseCodeForm")
Form1.Find(tblGraphExp.AnalysisCode)
Form1.GraphSelection = "Range of Periods"
Form1.GraphPeriodFrom = StartPeriod
Form1.GraphPeriodTo = EndPeriod
Form1.GraphField2 = ""
Form1.GraphField2 = ""
Form1.GraphField = "PeriodActivity"
End If
If Button = ebPrint Then
Report = CreateReport(tblGraphExp, " Expenses For Last 12 Months ")
Report.Destination = "Screen"
Report.Run
Handled = True
End If
End Sub
Sub OnLinkExpenses
Dim Form1 as Object
Form1 = CreateObject("Accredo.APExpenseDetailedReport")
Form1.Layout = "Expense Analysis Detail"
End Sub
(Ctrl+S).(Ctrl+R) to test the form.