Home / Community & Support / Knowledge Base / Telerik Reporting / Designing Reports / Calculate summaries based on User Functions

Calculate summaries based on User Functions

Article Info

Rating: 4

Article information

Article relates to

Telerik Reporting

Created by

Rossen, Telerik 

Last modified

06 December, 2007

Last modified by

Rossen, Telerik



HOW-TO
Add an average of calculated items in the footer section

SOLUTION
Summaries can be added on the User Functions in the same way as on data source fields. For example, if your summary function is:

    public static double CalculateOrderPrice(double unitPrice, int amount)
    {
        return (unitPrice * amount * 1.20); //with VAT :-)
    }


and your data field names are UnitPrice and Amount, you can set the following expression as the Value of a TextBox to calculate the Average of the results returned by the User Function:

=AVG(CalculateOrderPrice(UnitPrice, Amount))

Attached you can find a little project containing a report that demonstrates the above scenario.
 

Comments

  • aj , May 2, 2008

    I hope it will work on mine.thanks anyway...

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.