Print Page | Close Window

Filtering displayed rows

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=9825
Printed Date: 05 October 2024 at 2:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Filtering displayed rows
Posted By: Neil
Subject: Filtering displayed rows
Date Posted: 07 March 2008 at 11:58pm
I am using the Report control with VB6, and I want to be able to display a report (with say 3 columns and 100 rows), and I want to be able to filter the number of visible rows (i.e. rows displayed), by typing in a text box.

As I type into the textbox, all rows that do not have cells (in say the first column), that start with matching text, will be removed from the display.

So for example, suppose I have a 1 column report (for simplicity), and the rows in the report are as follows:

"The"
"The quick"
"The quick brown"
"The quick brown fox"
"The quick brown fox jumped"
"The quick brown fox jumped over the"
"The quick brown fox jumped over the lazy dog"

As I progressively type the well known pangram "The quick brown fox jumped over the lazy dog", into the textbox, the number of rows displayed in the report will be gradually reduced (as fewer and fewer rows satisfy the criteria of text starting with the entire typed string), until only the last row is visible.

Additionally, as I backspace the typed in string (i.e. remove the rightmost characters), more and more rows should be displayed again, as more rows match the criteria (text typed in the textbox).

Ideally, I would like to be able to specify the report column on which the match is made (i.e. the column which the criteria is tested on, to determine whether a row is visible or not.

Has anyone know how I may implement this?. A few lines of code demonstrating how this can be done will be very useful .



Replies:
Posted By: wlcabral
Date Posted: 08 March 2008 at 12:31pm

I can give you a Idea how I create this for my application (I´m using MS Foxpro)

Basically I create a association with a Timer and a Textbox.  Every time that a press a key my textbox I start my Timer.

 I set the Timer interval for 500 Milliseconds and in the Timer Event I just need to turn off the timer, set   the “filterText” property and populate.

In “InteractiveChange” Event for textbox :

timer1.Enabled = .t.

timer1.interval = 400

 

In “Timer” Event :

Timer.interval = 0      && Disable the Timer in Foxpro

xTremeReportControl.filterText= alltrim(textBox.value)

xTremeReportControl.Populate()



-------------
wlcabral


Posted By: Neil
Date Posted: 09 March 2008 at 4:05am
Thanks


Posted By: Aaron
Date Posted: 21 April 2008 at 7:16am
Hi,
 
Strange that you use a timer for this!?
 
If you are using a textbox the change event would do exactly the same.
 
Private Sub Text1_Change()
    wndReportControl.FilterText = Text1.Text
    wndReportControl.Populate
End Sub


Posted By: wlcabral
Date Posted: 21 April 2008 at 3:01pm

I didn´t want  to populate every key pressed by user. That´s why I use the Timer. When the user stops typing the populate occurs after 500 milliseconds...



-------------
wlcabral


Posted By: younicke
Date Posted: 25 April 2008 at 11:14am
Originally posted by wlcabral wlcabral wrote:

I can give you a Idea how I create this for my application (I´m using MS Foxpro)

Basically I create a association with a Timer and a Textbox.  Every time that a press a key my textbox I start my Timer.

 I set the Timer interval for 500 Milliseconds and in the Timer Event I just need to turn off the timer, set   the “filterText” property and populate.

In “InteractiveChange” Event for textbox :

timer1.Enabled = .t.

timer1.interval = 400

 

In “Timer” Event :

Timer.interval = 0      && Disable the Timer in Foxpro

xTremeReportControl.filterText= alltrim(textBox.value)

xTremeReportControl.Populate()



hello wlcabral,

based on the picture that you have attached... how did you managed to have your shortcut bar collapsible like the ones found in outlook 2007?

just wondering.

younicke


Posted By: wlcabral
Date Posted: 25 April 2008 at 5:07pm
I´m working with foxpro, so that´s the idea :
 
I create a container an inside this container a create the header area with a image for background to simulate the ´blue bar´, a text control to simulate the caption , the image "<<"  to simulate the collapse button a of course the shortcutbar.
 
When I click the mouse over the "<<" collapse button I just resize this container to a minimum size and hide the shortcutbar, I change the image to ">>" expand button and so on...
 
This is just a workarround until the guys from codejock put this option in shortcutbar control...
 


-------------
wlcabral


Posted By: vicos
Date Posted: 01 February 2013 at 3:25pm
Can share this example?



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