Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Filtering displayed rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Filtering displayed rows

 Post Reply Post Reply
Author
Message
Neil View Drop Down
Groupie
Groupie


Joined: 16 December 2007
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote Neil Quote  Post ReplyReply Direct Link To This Post Topic: Filtering displayed rows
    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 .
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Neil View Drop Down
Groupie
Groupie


Joined: 16 December 2007
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote Neil Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2008 at 4:05am
Thanks
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
vicos View Drop Down
Groupie
Groupie


Joined: 23 November 2009
Location: Romania
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote vicos Quote  Post ReplyReply Direct Link To This Post Posted: 01 February 2013 at 3:25pm
Can share this example?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.