![]() |
catch filter edit control from Report Control |
Post Reply ![]() |
Author | |
unknow ![]() Groupie ![]() ![]() Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
![]() ![]() ![]() ![]() ![]() Posted: 08 November 2009 at 10:36am |
I would like to intercept when the filter edit control has been changed in order to display a "# results found" message; I think I can find easily how to retrieve the number of items displayed in the report control;
But how can I know this is related to the filter applied ?
|
|
![]() |
|
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
Use BOOL CXTPReportFilterEditControl::OnChange()
|
|
![]() |
|
unknow ![]() Groupie ![]() ![]() Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
![]() ![]() ![]() ![]() ![]() |
Thanks; I suppose the only way to make additional features is to derivate a new class from CXTPReportFilterEditControl ?
I would like to intercept the filter change in order to reflect the number of elements found (i.e. Internet Explorer 8 search bar) but I also found that the interesting property CXTPReportControl::m_nPopulatedRecordsCount is "protected" as well;
Is there a turn-around to avoid having to derivate both classes ??
|
|
![]() |
|
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
CXTPReportFilterEditControl m_wndFilterEdit belong to your CXTPReportView derived class or smth similar (dialog?). You can create it (suppose with IDC_FILTER_EDIT as ID) or subclassed it
if (m_wndFilterEdit.GetSafeHwnd() == NULL) {
m_wndFilterEdit.SubclassDlgItem(IDC_FILTER_EDIT, &pWnd->m_wndFilterEdit); GetReportCtrl().GetColumns()->GetReportHeader()->SetFilterEditCtrl(&m_wndFilterEdit); } and can use notification e.g. ON_EN_CHANGE(IDC_FILTER_EDIT, You function) |
|
![]() |
|
unknow ![]() Groupie ![]() ![]() Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
![]() ![]() ![]() ![]() ![]() |
ok, I can intercept the notification message from either dialogbar or reportview, thankx.
but I still can't get the number of report items listed once the filter has been applied...
how can I access to CXTPReportControl::m_nPopulatedRecordsCount ? or how can I recalculate it ?
thankx ;)
|
|
![]() |
|
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
E.g. keep on app level prev record count and compare with new value after filter applied
|
|
![]() |
|
unknow ![]() Groupie ![]() ![]() Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
![]() ![]() ![]() ![]() ![]() |
Thanks! here's what I did when handling the ON_EN_CHANGE:
Get the number of items actually displayed : GetReportCtrl().GetRows()->GetCount();
Is it a good way to proceed, I mean, this function will always return the number of items displayed with or with no filter applied.
Note: maybe you should consider giving direct access to CXTPReportControl::m_nPopulatedRecordsCount in next release ?
|
|
![]() |
|
unknow ![]() Groupie ![]() ![]() Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
![]() ![]() ![]() ![]() ![]() |
One more consideration about : GetReportCtrl().GetRows()->GetCount()
This code returns the number of rows currently displayed in the report control; BUT it includes all the group rows at the same time.
What is the way to either
- calculate items displayed (not just visible) without counting group rows
or
- calculate only number of group rows (so I can then substract with previous value)
Thanks !!
|
|
![]() |
|
mdoubson ![]() Senior Member ![]() ![]() Joined: 17 November 2008 Status: Offline Points: 1705 |
![]() ![]() ![]() ![]() ![]() |
Use BOOL CXTPReportRow::IsGroupRow(); |
|
![]() |
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 |