Click to See Complete Forum and Search --> : Report List View?


July 6th, 2000, 10:34 AM
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!!!

funyman
July 6th, 2000, 10:44 AM
Maybe you should use the function GetItemText()

funyman
July 6th, 2000, 10:51 AM
OUPS!!!!
sorry I tought I was in VC++ forum
I was wandering where that function came from. lol
Good luck

Johnny101
July 6th, 2000, 11:21 AM
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