Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Record Visibility and Filter Text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Record Visibility and Filter Text

 Post Reply Post Reply
Author
Message
Fossil View Drop Down
Groupie
Groupie
Avatar

Joined: 29 April 2006
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fossil Quote  Post ReplyReply Direct Link To This Post Topic: Record Visibility and Filter Text
    Posted: 21 July 2008 at 6:36pm
Hi,

I was wondering if there is some hidden property kept in a Record that effects the filter text.  If I populate a report control with records setting 50% of them to Record.Visible=False, then use the filter text, the records that are not visible are not effected (good thing).  I guess my real question is how does the filter text work, it seems it doesn't start off by setting all records to visible.  I am trying to filter only a specific column but I get all the records back I originally set the visible=false if the filter text matches.

Any insight on the inner workings of it might help me.

Thanks
Product: Xtreme SuitePro (ActiveX) version 12.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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: 22 July 2008 at 1:49am
Hi,
 
If you want to loop trough the records that are visible use the wndReportControl.Rows (= collection of visible records)
 
example, just to show you that you don't need to loop trough entire records collection everytime:
 
    'filter the records with an "a" in it (only first column)
    Dim record As ReportRecord
    For Each record In wndReportControl.Records
        record.Visible = True 'make sure that record is visible to start with
        If record(0).Value Like "*a*" Then ' hide all records that contains "a"
                record.Visible = False
        End If
    Next record
    wndReportControl.Populate
 
    'On screen you wouldn't see a record item with the letter "a" (note: only first column), now loop through the "visible records" using the Rows collection.
 
    Dim row As ReportRow
    For Each row In wndReportControl.Rows
        if not row.Grouprow 'just to make sure it's a record when grouping is applied
            row.record(0).BackColor = vbRed
        endif
    Next row
    wndReportControl.Populate   
 
    'Make all records visible again to show that it works
    For Each record In wndReportControl.Records
        record.Visible = True
    Next record
    wndReportControl.Populate
 
 
Now all report items in column 0 will have a red background except the report items with an "a" in it.
 
Looping through the Rows this way, you can easely create custom filtering
on columns. Is the result not satisfying, loop again on the result and again and again.... The only thing you have to do is when starting a new filter make all records visible again.  
 
 
I think filtertext does the same internally, set visible to false when filtertext doesn't match.
 
Hope this will help you
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Fossil View Drop Down
Groupie
Groupie
Avatar

Joined: 29 April 2006
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fossil Quote  Post ReplyReply Direct Link To This Post Posted: 22 July 2008 at 8:44am
Actually, the issue is your sample sets all records to visible first which loses the initial visibility setting when the record gets added.  So if I add three records add set the third one to visible=false, populate it and then run the code, the record will become visible anyway.  Where as the CJ filter text keeps the record out of the filtertext search completely leaving it invisible.  I attached a sample.uploads/20080722_084417_Project2.zip
Product: Xtreme SuitePro (ActiveX) version 12.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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: 22 July 2008 at 9:54am
Hi,
 
The codesnippet was just to make a point. When using the FilterText property of RC all columns will be filtered, right?! To have filtering on columns you have to make a custom filter.
 
The above code snippet filters on 1 column with a certain text. You could loop through the collection using the RECORDS collection but then you have to know if the record is visible or not (you want to set some records visible = false, right?) so not using the RECORDS collection I said you could use the ROW collection to loop through (the ONLY visible) records. ROW collection =  what you see on the screen. So if you have 100.000 records added and you set 99.999 records visible = false, you have only one row to loop through.
 
example:
Now I want to filter on a certain column and have found 10.000 records and I want another filter because I see there are a lot of results. You can't do this with .FilterText so custom filtering needs to be done and thats why I said: do this on the ROW collection. Well I attached a sample to test what I mean.
 
Select a column and enter text, only those records will show. Select another column and enter text again. If you're done you can click reset to have all records visible again.
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 6:00am
Hi,
 
ReportControl does not change Record.Visible property. Filter just skip records if Record.Visible = False.
 
There is also ReportControl.FilterHiddenColumns property (which is False by default) to allow you apply filter for invisible columns data.
 
There is an internal property Column.Filterable (=True by default).
If you need I will publish it for next release.
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: 29 July 2008 at 6:45am
Originally posted by AndreiM AndreiM wrote:

Hi,
 
ReportControl does not change Record.Visible property. Filter just skip records if Record.Visible = False.
 
There is also ReportControl.FilterHiddenColumns property (which is False by default) to allow you apply filter for invisible columns data.
 
There is an internal property Column.Filterable (=True by default).
If you need I will publish it for next release.
 
Hi Andrei,
 
Does this mean we can set a filtertext and allow only filter on those columns which property Column.Filterable is set to true ? That would be great . We don't have to do a custom filter on columns anymore. I can use the property FilterText after all.
 
QUESTION: the thing I explained in previous reply about having a filter on rows or records is that possible also? If you don't understand what I mean, just let me know, OK?
 
Thanks a lot, again
 
btw,
Tell your collegues that the ReportControl is the best CJ control (and best of all competitor controls as well hehehe)
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Fossil View Drop Down
Groupie
Groupie
Avatar

Joined: 29 April 2006
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fossil Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 8:40am
Publish Please!  That would be a great help.  We have written a custom subroutine, but to have it embedded in the control would be the best way and benefit the most users.

Thanks
Product: Xtreme SuitePro (ActiveX) version 12.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
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.141 seconds.