Devexpress Pivotgrid:如何定义自定义摘要 [英] Devexpress Pivotgrid: How to define custom summary

查看:934
本文介绍了Devexpress Pivotgrid:如何定义自定义摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由ASPxpivotgrid制作的枢纽网格。任何人做了一个pivotgrid都知道,在pivotgrid中有一个可选的行摘要行。它有一些选项,如Sum,Avg,Min,Max,Var等,但我需要在摘要行中具有最小/最大值。我知道还有另一个选项,如自定义,但是虽然我检查了很多示例和页面,但我找不到任何明确的例子来描述如何定义自定义摘要。



我的问题是如何定义自定义摘要?

解决方案

这应该是相似的,但它来自winform一边。



有一个事件'CustomCellDisplayText',每次绘制一个单元格时都会被调用。在此您可以检查单元格是否是汇总单元格。

  Private Sub PivotGridControl1_CustomCellDisplayText(sender As System.Object,e作为DevExpress.XtraPivotGrid.PivotCellDisplayTextEventArgs)处理PivotGridControl1.CustomCellDisplayText 
'格式列总计
如果e.RowValueType = DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal然后
'做某事
结束If

'格式行总计
如果e.ColumnValueType = DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal然后
'做某事
End If
End Sub


I have a pivot grid made by ASPxpivotgrid. As anyone whoever made a pivotgrid would know, there is an optional row summary line in pivotgrid. It has some options like Sum, Avg, Min, Max, Var etc. but I need to have Min / Max in the summary line. I know there is another option like "Custom" but although I checked so many examples and pages, I couldn't find any clear example that describes how to define a Custom summary.

My question is, how to define a custom summary?

解决方案

This should be similar, but it comes from the winform side.

There is an event 'CustomCellDisplayText' that gets called each time a cell is drawn. Within this you can check to see if the cell is a summary cell.

Private Sub PivotGridControl1_CustomCellDisplayText(sender As System.Object, e As DevExpress.XtraPivotGrid.PivotCellDisplayTextEventArgs) Handles PivotGridControl1.CustomCellDisplayText
    ' format column totals
    If e.RowValueType = DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal Then
      ' do something
    End If

    ' format row totals
    If e.ColumnValueType = DevExpress.XtraPivotGrid.PivotGridValueType.GrandTotal Then
      ' do something
    End If
End Sub

这篇关于Devexpress Pivotgrid:如何定义自定义摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆