Print Page | Close Window

Determining Which Rows are NOT visible

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=5207
Printed Date: 16 September 2024 at 4:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Determining Which Rows are NOT visible
Posted By: jcollier
Subject: Determining Which Rows are NOT visible
Date Posted: 03 October 2006 at 4:38pm
How would I loop through the rows to set rows that are not visible to visible?

When I do the following I get Invalid Procedure Call after it gets to the count of visible rows.

For i = 0 To rpt.Records.count - 1
     If rpt.Rows(i).GroupRow = False Then
           rpt.Rows(i).Record.Visible = True
      End If
Next i

In this case, rpt.records.count = 77.  The number of visible rows when I run this is 14.  So, when i gets to 14, it gives the error.



Replies:
Posted By: sserge
Date Posted: 03 October 2006 at 5:45pm
Obviously, you have to iterate Records, not Rows. Like below:

For i = 0 To rpt.Records.count - 1
     If rpt.Records(i).Visible = False Then
           rpt.Records(i).Record.Visible = True
      End If
Next i


If you need to check some value on the corresponding Row, use FindRow method:

Dim r As ReportRow
... then inside a loop
Set r = rpt.Rows.FindRow(rpt.Records(i))
If not r is Nothing ' mean if corresponding row exists
'' check something
End If


--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net