Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - catch filter edit control from Report Control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

catch filter edit control from Report Control

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

Joined: 14 January 2009
Location: Belgium
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote unknow Quote  Post ReplyReply Direct Link To This Post Topic: catch filter edit control from Report Control
    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 ?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2009 at 11:24am
Use BOOL CXTPReportFilterEditControl::OnChange()
Back to Top
unknow View Drop Down
Groupie
Groupie
Avatar

Joined: 14 January 2009
Location: Belgium
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote unknow Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2009 at 5:39pm
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 ??
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2009 at 8:25pm

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)
Back to Top
unknow View Drop Down
Groupie
Groupie
Avatar

Joined: 14 January 2009
Location: Belgium
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote unknow Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2009 at 6:09pm
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 ;)
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2009 at 6:22pm
E.g. keep on app level prev record count and compare with new value after filter applied
Back to Top
unknow View Drop Down
Groupie
Groupie
Avatar

Joined: 14 January 2009
Location: Belgium
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote unknow Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2009 at 12:52pm
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 ?
Back to Top
unknow View Drop Down
Groupie
Groupie
Avatar

Joined: 14 January 2009
Location: Belgium
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote unknow Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2009 at 6:48pm
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 !!
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2009 at 6:51pm

Use BOOL CXTPReportRow::IsGroupRow();

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.203 seconds.