Ejemplo n.º 1
0
    protected void ASPxPivotGrid1_CustomSummary(object sender, DevExpress.Web.ASPxPivotGrid.PivotGridCustomSummaryEventArgs e)
    {
        decimal discount            = Convert.ToDecimal(e.SummaryValue.Summary);
        decimal unitPrice           = 0;
        PivotDrillDownDataSource ds = e.CreateDrillDownDataSource();

        for (int i = 0; i < ds.RowCount; i++)
        {
            unitPrice += Convert.ToDecimal(ds[i]["UnitPrice"]);
        }
        e.CustomValue = new SBSInf(discount, unitPrice);
    }
Ejemplo n.º 2
0
    protected void ASPxPivotGrid1_CustomSummary(object sender, DevExpress.Web.ASPxPivotGrid.PivotGridCustomSummaryEventArgs e)
    {
        PivotDrillDownDataSource ds = e.CreateDrillDownDataSource();

        if (DataProvidesSameValues(ds, fieldCurrency))
        {
            e.CustomValue = e.SummaryValue.Summary;
        }
        else
        {
            decimal customValue = 0;
            for (int i = 0; i < ds.RowCount; i++)
            {
                if (Equals(ds[i][fieldCurrency], ASPxComboBox1.SelectedItem.Value))
                {
                    customValue += Convert.ToDecimal(ds[i][e.DataField]);
                }
            }
            e.CustomValue = customValue;
        }
    }