Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Hiding sorted field in group header
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Hiding sorted field in group header

 Post Reply Post Reply
Author
Message
tobi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 September 2004
Location: Germany
Status: Offline
Points: 451
Post Options Post Options   Thanks (0) Thanks(0)   Quote tobi Quote  Post ReplyReply Direct Link To This Post Topic: Hiding sorted field in group header
    Posted: 19 May 2006 at 2:30pm

If I sort Report Control the group headers contain the field name which the control is sorted. E.g. if I sort by Date all group header start by Date : XYZ.
Is is possible to hide this information ? The group header should only display XYZ ( in this example ) ?

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2006 at 5:26pm
Hello,

Yes, just use .GroupCaption property for an item of this column.
See VB sample, method SetDateItem.

    'This block of code determines the GroupPriority and GroupCaption of the Item
    'based on the date or generated provided.  If the date is the current date, then this Item will
    'have High group and sort priority, and will be given the "Today" groupcaption.
    If (Month(dt) = Month(Now)) And (Day(dt) = Day(Now)) And (Year(dt) = Year(Now)) Then
        Item.GroupCaption = "Today"
        Item.GroupPriority = 0
    ElseIf (Month(dt) = Month(Now)) And (Year(dt) = Year(Now)) Then
        Item.GroupCaption = "This Month"
        Item.GroupPriority = 1
    ElseIf (Year(dt) = Year(Now)) Then
        Item.GroupCaption = "This Year"
        Item.GroupPriority = 2
    Else
        Item.GroupCaption = "Older"
        Item.GroupPriority = 3
    End If


--
WBR,
Serge
Back to Top
Timo View Drop Down
Newbie
Newbie


Joined: 30 May 2006
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Timo Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2006 at 4:45am

This works indeed, but I noticed something strange:

the groups are not correctly sorted when you use the groupcaption option. It seems like the it sorts by the groupcation and not by the value of the recordItem.

This is a problem when you're grouping by a date column and you want a formatted date in the groupcaption (in my case format "dd-mm-yyyy").

 

 

 

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 04 June 2006 at 8:17am
Timo,

It sorts groups by GroupPriority if exists, then by GroupCaption if exists, and after that it sorts rows by rows values.

Could you please share your piece of code which doesn't work correctly?

--
WBR,
Serge
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.172 seconds.