Developing Chart Of Accounts - How to use trees & tree nodes

Hello

i m making an accounting application, i m developing a form that loads the company's COA, i want to show the copp's COA in tree

my question is how does i make a child node in the tree?

how do i keep track where is the root node, where is the 1st level 2d level node etc

i have a sample in vb 6 which is a piece of cake but haven't got one single in vb.net

i m using vb.net 2003, please help

also tell how do we sort a data table in vb.net

[524 byte] By [maqk] at [2008-1-12]
# 2

is there some1 who has experience of developing an accounting business application, he/she must have gone through the Chart of accounts module which deserves a tree view,

what i simply wanna do is to master tree vew control, populate it through database records, analyze which tree node is gonna get the next record as child, all at RUN time. Its exactly like how we do in windows expolorer, the tree showing folders, & folders/files within that folder, its all dynamic, not hardcoded, it makes folders within folders depending on how you keep files in your disk

thats what i wanna do, Fixed Assets in Assets, Levels maintaned dynamicallty all at runtime, some1 gone through with something like this b4

the samples you sent were not good enough Paul, i already searched there & never got what exactly i wanted, any way tks for your response

maqk at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 3
Have u succeeded in COA tree? Have u develop accounting s/w.
Khaleeq at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 4

I know exactly what you are going through.

It is really based on how your COA is laid out. Here is how I have mine. I have my base group as a identity field (Fund, Department, Account) groups. I then have go through my accounts.

Private Sub FinancialsAccountTree_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.COAFormatTableAdapter.Fill(Me.VisionDataSet.COAFormat)

Me.COABaseTableAdapter.Fill(Me.VisionDataSet.COABase)

Dim Work1 As Integer

For Each DataRow As Data.DataRow In Me.VisionDataSet.COAFormat

Dim FormatRow As VisionDataSet.COAFormatRow = DataRow

If FormatRow.FormatGroup <> Work1 Then

Dim NewNode As New TreeNode

NewNode.Name = FormatRow.COAFormatID.ToString

NewNode.Text = FormatRow.FormatDescription

Me.TreeView1.Nodes.Add(NewNode)

LoadBaseChild(NewNode)

Work1 = FormatRow.FormatGroup

End If

Next

End Sub

Private Sub LoadBaseChild(ByVal ParentTree As TreeNode)

For Each DataRow As Data.DataRow In Me.VisionDataSet.COABase

Dim BaseRow As VisionDataSet.COABaseRow = DataRow

Me.TreeView1.SelectedNode = ParentTree

Try

If BaseRow.BaseType.ToString = ParentTree.Name Then

Dim NewNode As New TreeNode

NewNode.Name = BaseRow.COABaseID.ToString

NewNode.Text = BaseRow.BaseNumber.ToString & " " & BaseRow.BaseDescription

Me.TreeView1.SelectedNode.Nodes.Add(NewNode)

LoadAccountChildren(NewNode)

End If

Catch ex As Exception

End Try

Next

End Sub

Private Sub LoadAccountChildren(ByVal ParentTree As TreeNode)

For Each DataRow As Data.DataRow In Me.VisionDataSet.COABase

Dim BaseRow As VisionDataSet.COABaseRow = DataRow

Me.TreeView1.SelectedNode = ParentTree

Try

If BaseRow.COAParentID.ToString = ParentTree.Name Then

Dim NewNode As New TreeNode

NewNode.Name = BaseRow.COABaseID.ToString

NewNode.Text = BaseRow.BaseNumber.ToString & " " & BaseRow.BaseDescription

Me.TreeView1.SelectedNode.Nodes.Add(NewNode)

LoadAccountChildren(NewNode)

End If

Catch ex As Exception

End Try

Next

End Sub

WilliamDGJones at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 5

I did it, MashaAllah, my self, Alhamdulillah

tks Williams for the reply, but fopr me it was a bit outdted as I had to complete the assignment in time, but hey Williams, please stay in touch, cause Khaleeq as you asked, yes, I am making a Accounts software.

Williams I will do check your provided method for sure

tks guys all for yor replies!!!

maqk at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 6

Dear maqk and Williams

I am not a developer. I am an accountant with over 25 years of experience in using different accounting and ERP solutions.

If you need any assistance or clarification in accounting concept pls do not hesitate to contact me.

If you want me to test your s/w or review it , you may forward me your copy.

Regards

Khaleeq

Khaleeq at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 7
hmn... if my manager allows only then, which i fear he won't because the product only completly belongs to him
maqk at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...
# 8

SALAM, i need you help Khaleeq. please provide your email address.

Thans.

waqaszahoor@msn.com

WaqasZahoor at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic Power Packs...