View Full Version : Can the ReportControl do Outlook Inbox type sorting ?
chuckatkinson
11-Nov-2009, 09:34 AM
Any ideas how I could use the ReportControl to provide Outlook Inbox type sort functionality?
For instance if I click on Date for sorting, I'd like to do grouping by date with expand/collapse buttons and the Group Row caption showing Date:Today Date:Yesterday etc.
Or for instance if I click on From - have it group sort by the Sender name From:Ian Smith (5 items)
The above are examples. I'm not trying to recreate the Inbox, just would like the same kind of functionality especially for Date sorting...
Thanks,
Ian Smith
11-Nov-2009, 10:29 AM
Hi Chuck
Take a look at event : OnComSortOrderChanged - for picking up the header click
Then you will need to play with events : OnSetOrdering & OnSetGrouping
These two events allow you to specify which columns should be used for grouping and ordering. They are both past an array byRef of type tdRC_Ordering.
tdRC_Ordering is defined as
Integer iColumn - zero based
Boolean bDescending - True descending / false ascending.
Just set the column numbers required.
Then you will need to
Send DoSetColumnOrdering
Send DoSetColumnGrouping
It is these methods that fire the OnSet??? events.
chuckatkinson
16-Nov-2009, 12:15 PM
Take a look at event : OnComSortOrderChanged - for picking up the header click
I've got sorting working pretty much like I want except I can't figure out how to pickup the header click.
I'm kinda following along with the Xtreme example using the MouseDown. And I have to admit I don't have enough understanding of this Com object stuff. I probably need to take Vincent's course :confused:
Here's the direction I'm headed.
Procedure OnComMouseDown Short llButton Short llShift Integer llx Integer lly
Handle hoReportHitTestInfo
Variant vHitTest
Forward Send OnComMouseDown llButton llShift llx lly
Get Create U_cSigCjComReportHitTestInfo to hoReportHitTestInfo
Set pvComObject of hoReportHitTestInfo to vHitTest
End_Procedure
I get an Illegal Datatype error when trying to set the pvComObject above. :o
I was hoping to get the ComColumn of the hoReportHitTestInfo object.
Am I headed in the right direction ? And if it's not too much to ask - what am I doing wrong with the pvComObject ?
Thanks
chuckatkinson
16-Nov-2009, 03:34 PM
Getting further ...
Procedure OnComMouseDown Short llButton Short llShift Integer llx Integer lly
Handle hoReportHitTestInfo hoReportColumn
Variant vHitTest vCol
Integer iHeaderTest
Boolean bok
String sCaption
Forward Send OnComMouseDown llButton llShift llx lly
Get Create U_cSigCjComReportHitTestInfo to hoReportHitTestInfo
Get ComHitTest llx lly to vHitTest
Set pvComObject of hoReportHitTestInfo to vHitTest
Get ComHt of hoReportHitTestInfo to iHeaderTest
// If it's the header
If (iHeaderTest=1) Begin
Get ComColumn of hoReportHitTestInfo to vCol
Get phoReportColumn to hoReportColumn
Set pvComObject of hoReportColumn to vCol
Get ComCaption of hoReportColumn to sCaption
End
End_Procedure
So the sCaption is showing me the caption of the column clicked ...
All this was incredibly cool and exciting !!! ...... until (and I'm still laughing at myself:D) I found I could set the property ComShowItemsInGroups in the ReportControl and get the behaviour I was trying for ... DOH !!!!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.