CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    Report List View?

    I am using a listview (Line_Type) with 2 columns and X amount of rows. When I go to save this table I use:


    for Count = 1 to Line_Type.ListItems.Count
    Write #9, Line_Type.ListItems(Count).Text, Line_Type.SelectedItem.SubItems(1)
    next Count




    The problem is that it will grab all the different fields in column 1 but it only takes column 2's row 1 info. For example:
    MY TABLE:
    ___________
    A | B
    C | D
    E | F
    G | H
    I | J

    The text output file looks like this:
    "A","B","C","B","E","B","G","B","I","B"

    I want to have it look like this:
    "A","B","C","D","E","F","G","H","I","J"

    Thanks for any advice!!!


  2. #2
    Join Date
    Jun 2000
    Location
    canada
    Posts
    41

    Re: Report List View?

    Maybe you should use the function GetItemText()



  3. #3
    Join Date
    Jun 2000
    Location
    canada
    Posts
    41

    Re: Report List View?

    OUPS!!!!
    sorry I tought I was in VC++ forum
    I was wandering where that function came from. lol
    Good luck


  4. #4
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Report List View?

    your code is using the selected item for the second item, when really it should be iterating through the collection like yuo are doing for the rows...

    'your code:
    for Count = 1 to Line_Type.ListItems.Count
    Write #9, Line_Type.ListItems(Count).Text, Line_Type.SelectedItem.SubItems(1)
    next Count

    'change the second line to
    Write #9, Line_Type.ListItems(Count).Text, Line_Type.ListItems(Count).SubItems(1)




    that should do it.

    hope this helps,

    John




    John Pirkey
    MCSD
    http://www.ShallowWaterSystems.com
    http://www.stlvbug.org
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

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

Featured