Print Page | Close Window

catch filter edit control from Report Control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=15568
Printed Date: 11 May 2024 at 7:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: catch filter edit control from Report Control
Posted By: unknow
Subject: catch filter edit control from Report Control
Date 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 ?



Replies:
Posted By: mdoubson
Date Posted: 08 November 2009 at 11:24am
Use BOOL CXTPReportFilterEditControl::OnChange()

-------------
Mark Doubson, Ph.D.


Posted By: unknow
Date 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 ??


Posted By: mdoubson
Date 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)


-------------
Mark Doubson, Ph.D.


Posted By: unknow
Date 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 ;)


Posted By: mdoubson
Date Posted: 11 November 2009 at 6:22pm
E.g. keep on app level prev record count and compare with new value after filter applied

-------------
Mark Doubson, Ph.D.


Posted By: unknow
Date 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 ?


Posted By: unknow
Date 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 !!


Posted By: mdoubson
Date Posted: 17 November 2009 at 6:51pm

Use BOOL CXTPReportRow::IsGroupRow();



-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net