Record Visibility and Filter Text |
Post Reply |
Author | |
Fossil
Groupie Joined: 29 April 2006 Status: Offline Points: 46 |
Post Options
Thanks(0)
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Fossil
Groupie Joined: 29 April 2006 Status: Offline Points: 46 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
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.
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Fossil
Groupie Joined: 29 April 2006 Status: Offline Points: 46 |
Post Options
Thanks(0)
|
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 |
|
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 |