Ticket Q256555
Visible to All Users

ASPxGridView - Group footer custom summary - group row count of specific group field for each group

created 15 years ago

I need to calculate a percentage of time that is billable calculation for groups.
I am grouping by Manager,Employee, Month,Timesheet… the timesheet has multiple rows for different projects worked.
I need to calculate the percentage of time that has been submitted that is billable based on a 40 hour work week for each grouping.
I have successfully calculated the percentage for each data row. I cannot seem to get the number of timesheet group rows to calculate how many timesheets or 40 hour increments that I need to use for calculation. I always get the number of data rows.
I attached the files i'm working on… the screen.jpg is a sample of what i'm trying to do.

Show previous comments (4)
DevExpress Support Team 15 years ago

    Hi Ira:
    I'm working on this question and will answer you as soon as possible. Please accept my apologies for the delay.
    Thanks
    Kate.

      Thank you…

      DevExpress Support Team 15 years ago

        Hi Ira:
        I'm sorry for the delay.
        I assume that you can create two group summaries for the "docnbr" column. One of them will be hidden and will have the Sum type. The other one will be visible and will have the Custom type:
        <GroupSummary>
                         <dx:ASPxSummaryItem FieldName="docnbr" SummaryType="Sum" />
                          <dx:ASPxSummaryItem FieldName="docnbr" ShowInGroupFooterColumn="UnitPrice" DisplayFormat="{0}" SummaryType="Custom"/>
        </GroupSummary>
         Also, a grid should have a total summary for the "total_hrs" column with the type Sum and custom group summaries for the "Period", " Employee" and "Approver" columns.
        The custom summaries should be calculated using a value from the hidden "docnbr" summary in the CustomSummaryCalculate event handler. For example:

        C#
        protected void grid_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e) { if (e.IsGroupSummary) { int timesheets = Convert.ToInt32(e.GetGroupSummary(e.GroupRowHandle, grid.GroupSummary["docnbr"])); int totalHours = Convert.ToInt32(grid.GetTotalSummaryValue(grid.TotalSummary["total_hrs"])); e.TotalValue = timesheets*40/totalHours; } }

        Thanks
        Kate.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.