Results 1 to 4 of 4

Thread: ListView Report Mode View - RESOLVED

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2003
    Location
    Georgia
    Posts
    32

    Resolved ListView Report Mode View - RESOLVED

    When I change to report mode view nothing is showing up in my listview. When I change it to List view my data shows up. Any ideas?

    VB Code:
    1. Private Sub LoadTableSpecs()
    2.    
    3.     Dim oSQLServer As New SQLDMO.SQLServer
    4.     Dim oSQLDatabase As New SQLDMO.Database
    5.     Dim oSQLTable As New SQLDMO.Table
    6.     Dim oSQLColumn As New SQLDMO.Column
    7.    
    8.     Dim i As Integer
    9.     Dim liObject As ListItem
    10.    
    11.     ListView1.ListItems.Clear
    12.    
    13.     oSQLServer.LoginSecure = True
    14.     oSQLServer.Connect Form1.cboServer1.Text
    15.     Set oSQLDatabase = oSQLServer.Databases(Form1.cboDatabase1.Text)
    16.     Set oSQLTable = oSQLDatabase.Tables(Form1.cboTable1.Text)
    17.    
    18.     For Each oSQLColumn In oSQLTable.Columns
    19.        
    20.         Set liObject = ListView1.ListItems.Add(, , oSQLColumn.Name)
    21.         liObject.SubItems.Add , , oSQLColumn.Datatype
    22.         liObject.SubItems.Add , , oSQLColumn.Length
    23.         Set liObject = Nothin
    24.    
    25.     Next
    26.    
    27. oSQLServer.DisConnect
    28. Set oSQLServer = Nothing
    29. End Sub
    Last edited by odamsr; Jun 15th, 2005 at 02:21 PM. Reason: Resolved

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: ListView Report Mode View

    You need to add ColumnHeaders before adding items.

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: ListView Report Mode View

    Here is a quick sample for you:
    VB Code:
    1. Private Sub Form_Load()
    2. Dim j%
    3.  
    4.     ListView1.FullRowSelect = True
    5.     ListView1.View = lvwReport
    6.     With ListView1.ColumnHeaders
    7.         .Add , , "List Item"
    8.         For j = 1 To 3
    9.             .Add , , "Sub Item " & j
    10.         Next j
    11.     End With
    12.    
    13.     ListView1.ColumnHeaders(2).Alignment = lvwColumnCenter
    14.     ListView1.ColumnHeaders(3).Alignment = lvwColumnRight
    15.  
    16. End Sub

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2003
    Location
    Georgia
    Posts
    32

    Resolved Re: ListView Report Mode View

    That worked. I don't know what I would do without you guys.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width