Home Forums WinForms controls Xceed Grid for WinForms Summary Row Percentage Total

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15903 |

    For a grid with sales, profit and profit margin percentage columns and grouped by customer, I would like to have a SummaryRow showing the totals for each column.

    For the sales and profit columns this is easy to do with a Sum StatFunction, but how can I display a meaningful profit margin percentage?

    It should be calculated from the sales and profit totals, but I can’t see an easy way of doing this.
    Is there any sample code showing how to do this?

    Imported from legacy forums. Posted by Chris (had 3092 views)

    Xceed Support
    Member
    Post count: 5658

    You could use the StatFunction.Average StatFunction on all the percentages of the profit margin percentage column. Wouldn’t it do the same as calculating it from the sales and profit totals?

    Imported from legacy forums. Posted by CharlesB (had 312 views)

    User (Old forums)
    Member
    Post count: 23064

    No it isn’t the same and could be quite misleading, for example:

    Sales Profit Margin
    1000 400 40%
    100 10 10%

    Totals:
    1100 410

    Average Margin: 25%
    Total Profit Margin: 37.3%

    Imported from legacy forums. Posted by Chris (had 417 views)

    User (Old forums)
    Member
    Post count: 23064

    This will not be doable with the SummaryRow, since the design of the SummaryCell is to use the values contained in one column to calculate a result according to the stat function. It was not designed to be able to take the result of other SummaryCell’s and calculate a result for another SummaryCell.

    You will need to implement this yourself.

    Imported from legacy forums. Posted by André (had 4072 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.