Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
There is one requirement is my application:

There is application which is developed in vb.The application has a database that holds all the fund ID's, fund names etc.

The application uses this database to complete the switch letters/switch spreadsheet we produce.

The issue is occuring because some funds have the same Fund Name but different Fund ID's.

For Example:-

Fund ID System Fund Name

829 Av Aberdeen NthAmerEqtyS2

905 Av Aberdeen NthAmerEqtyS2

As you can see the names are the same.

This doesn't cause an issue with the Switch Letters we produce as we do not include the Fund ID.

However, for the Switch spreadsheet that is sometimes produced, this does include the Fund ID & therefore, for the example above, we would quote 829 as the Fund ID rather than 905.

This would suggest to me that we are working out the Fund ID from the Fund Name rather than working out the Fund Name from the Fund ID.

As per my analysis in this application there are some listviews are being used and there only the field values are displaying after fetching he data from the DB.But while printing in the Excelsheet its creatng probem.Wrong value(Fund code is comming in excelspread sheet)which are not correct.
Could you anyone have a look on this and have a response regarding this ssue.
Posted
Comments
Kschuler 30-Nov-11 11:45am    
You're question is very confusing. Can you please indicate exactly how it is supposed to work and then how it is working right now. Generally if there is an ID and Name for something, you want to use the ID to lookup the name and not vice versa.
DaveAuld 30-Nov-11 12:09pm    
And your question is what exactly? What do you want us to look at, we have no idea you implementation, and there isn't enough to be going on in the text above from what I can see...
coded007 30-Nov-11 23:16pm    
Please use Fund ID's also in list view so it will be helpful

1 solution

I think you said the grouping model,

VB
Public Sub ListviewFill_Group()
        Try
            Dim lvGroup As ListViewGroup
            Dim lvItem As ListViewItem

            sLV.lv.Items.Clear()
//Select Distinct(FundID) From FundDetails...
            rsSql = objConn.ResultSet("PLACE your Sql Query")
            If rsSql.HasRows Then
                Do While rsSql.Read
                    'MsgBox(rsSql.Item(0))
                    lvGroup = New ListViewGroup(rsSql.Item(0))
                    lvGroup.Items.Add(rsSql.Item(0))
                    sLV.lv.Groups.Add(lvGroup)
                    'rsSql1 = objConn.ResultSet(sLV.lvSub & " where " & sLV.lvWhereCondForSub)
                    If sLV.lvOrderBy <> "" Then
                        SQry = sLV.lvSub & " where " & sLV.lvDistColumn & "='" & rsSql.Item(1) & "' Order by " & sLV.lvOrderBy & " ASC"
                    Else
                        SQry = sLV.lvSub & " where " & sLV.lvDistColumn & "='" & rsSql.Item(1) & "'"
                    End If
                    rsSql1 = objConn.ResultSet(SQry)
                    If rsSql1.HasRows Then
                        Do While rsSql1.Read
                            lvItem = New ListViewItem(New String() {rsSql1.Item(0), rsSql1.Item(1), rsSql1.Item(2), rsSql1.Item(3), rsSql1.Item(4)}, 1, lvGroup)
                            ' lvItem.Group = lvGroup
                            sLV.lv.Items.Add(lvItem)
                        Loop
                    End If
                    rsSql1 = Nothing

                Loop
            End If
            'sLV.lv.Groups.Add(lvGroup)


        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub
 
Share this answer
 
v2
Comments
Maciej Los 5-Dec-11 11:58am    
Do not use "Treat my content as plain text, not as HTML" link if you want to show the part of code. Always use <pre lang="vb">code</pre> tags.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900