Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    loop item in listview1 and fill report (6.0)

    I have a listview1 with 7 column and the item in columns are just filled
    Now i want to fill the typical datareport name STAMPA.dsr in .Sections("Section5").Controls where are 7 label named label1, label2...label7
    with the value in listview...

    similar:

    item1 of listview1 in Sections("Section5").Controls("label1").Caption =first item of column 1
    item1 of listview1 in Sections("Section5").Controls("label2").Caption =first item of column 2
    ...
    item1 of listview1 in Sections("Section5").Controls("label7").Caption =first item of column 7

    loop value in listview do until item are blank...

    Hope undeastnd me..

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: loop item in listview1 and fill report (6.0)

    Since you probably filled the listview from a recordset, you might as well use the recordset to populate the label captions.

    Otherwise you'd have to do something like this:

    Dim i as Integer
    Dim j As Integer
    For i = 0 To ListView1.ListItems.Count - 1
    For j = 1 To ListView1.ListItems(i).ListSubItems.Count
    ' do something with ListView1.ListItems(i).ListSubItems(j)
    Next j
    Next i

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: loop item in listview1 and fill report (6.0)

    Sorry, the line above that should have been

    For i = 1 To ListView1.ListItems.Count

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: loop item in listview1 and fill report (6.0)

    Large image removed by HansV since it didn't provide any relevant information

    have error , possible???
    Here:
    For j = 1 To ListView1.ListItems(i).ListSubItems.Count

Posting Permissions

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