Filtering displayed rows |
Post Reply |
Author | |
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
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 . |
|
wlcabral
Groupie Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
Post Options
Thanks(0)
|
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
|
|
Neil
Groupie Joined: 16 December 2007 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Thanks
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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 |
|
wlcabral
Groupie Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
Post Options
Thanks(0)
|
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
|
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
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 |
|
wlcabral
Groupie Joined: 25 April 2007 Location: Brazil Status: Offline Points: 72 |
Post Options
Thanks(0)
|
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
|
|
vicos
Groupie Joined: 23 November 2009 Location: Romania Status: Offline Points: 14 |
Post Options
Thanks(0)
|
Can share this example?
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |