Print Page | Close Window

Selecting Report Row

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1964
Printed Date: 17 November 2024 at 9:56pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Selecting Report Row
Posted By: DDJJ
Subject: Selecting Report Row
Date Posted: 14 March 2005 at 1:09pm

Besed upon user input, we want to select a particlar report row for focus in code.  Currently, we are iterating through the Rows collection to find and select the report row.  On larger reports, this can be time consuming.

Is there a way to set the focus on a row via using some kind of unique identifier for each row/record?

Dan




Replies:
Posted By: SuperMario
Date Posted: 14 March 2005 at 1:16pm
You can try to use BeforeDrawRow to check the row to see if it is the one you are looking for.  This way you are checking for your row as the before the row is being drawn.  You won't have to manually iterate through the rows.


Posted By: DDJJ
Date Posted: 14 March 2005 at 1:35pm

I don't think I understand your response, or maybe my question is vague.

Say our user already has a report drawn on their screen with 100 records/rows.  Assume the user takes some other action which requires that the FocusedRow in the report control be moved to a different record/row on the report. The BeforeDrawRow event is not called under these circumstances, correct?

Thanks!



Posted By: SuperMario
Date Posted: 14 March 2005 at 2:47pm
Hmm, after thinking this through, this solution would only work if the other row you want to focus is currently visible.


Posted By: DDJJ
Date Posted: 14 March 2005 at 3:13pm

What I'm doing now seems kind of inefficient:

Dim oRow As ReportRow
   
    With objReport
        For Each oRow In .Rows
             If Not oRow.GroupRow Then
                 If oRow.Record.Tag = lItemID Then
                     .FocusedRow = oRow
                     Exit For
                 End If
             End If
        Next
    End With

Would rather see something along the lines of:

objReport.FocusedRow = objReport.Rows.Selected.Tag(lItemID)

or something similar...



Posted By: DDJJ
Date Posted: 17 March 2005 at 8:59am
So I will assume there is no way to set the "FocusedRow" based upon some unique ID without first have to iterate through the Rows collection, correct?


Posted By: SuperMario
Date Posted: 17 March 2005 at 9:25am
I don't see an obvious answer for this.  Mabye send in a feature request for a ReportRecords.Find method or similar.


Posted By: DDJJ
Date Posted: 17 March 2005 at 9:32am
Thanks SuperMario.  Will put on my to do list!



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