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]
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
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.LoadMe.COAFormatTableAdapter.Fill(Me.VisionDataSet.COAFormat)Me.COABaseTableAdapter.Fill(Me.VisionDataSet.COABase)Dim Work1 As IntegerFor Each DataRow As Data.DataRow In Me.VisionDataSet.COAFormatDim FormatRow As VisionDataSet.COAFormatRow = DataRowIf FormatRow.FormatGroup <> Work1 ThenDim NewNode As New TreeNodeNewNode.Name = FormatRow.COAFormatID.ToString
NewNode.Text = FormatRow.FormatDescription
Me.TreeView1.Nodes.Add(NewNode)LoadBaseChild(NewNode)
Work1 = FormatRow.FormatGroup
End IfNextEnd SubPrivate Sub LoadBaseChild(ByVal ParentTree As TreeNode)For Each DataRow As Data.DataRow In Me.VisionDataSet.COABaseDim BaseRow As VisionDataSet.COABaseRow = DataRowMe.TreeView1.SelectedNode = ParentTreeTryIf BaseRow.BaseType.ToString = ParentTree.Name ThenDim NewNode As New TreeNodeNewNode.Name = BaseRow.COABaseID.ToString
NewNode.Text = BaseRow.BaseNumber.ToString &
" " & BaseRow.BaseDescriptionMe.TreeView1.SelectedNode.Nodes.Add(NewNode)LoadAccountChildren(NewNode)
End IfCatch ex As ExceptionEnd TryNextEnd SubPrivate Sub LoadAccountChildren(ByVal ParentTree As TreeNode)For Each DataRow As Data.DataRow In Me.VisionDataSet.COABaseDim BaseRow As VisionDataSet.COABaseRow = DataRowMe.TreeView1.SelectedNode = ParentTreeTryIf BaseRow.COAParentID.ToString = ParentTree.Name ThenDim NewNode As New TreeNodeNewNode.Name = BaseRow.COABaseID.ToString
NewNode.Text = BaseRow.BaseNumber.ToString &
" " & BaseRow.BaseDescriptionMe.TreeView1.SelectedNode.Nodes.Add(NewNode)LoadAccountChildren(NewNode)
End IfCatch ex As ExceptionEnd TryNextEnd SubI 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!!!
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