Print Page | Close Window

Hiding sorted field in group header

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=4250
Printed Date: 05 October 2024 at 4:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Hiding sorted field in group header
Posted By: tobi
Subject: Hiding sorted field in group header
Date 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 ) ?




Replies:
Posted By: sserge
Date 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


Posted By: Timo
Date 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").

 

 

 



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



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