ASPxPivotGrid 属性
来源:互联网 发布:不知为不知是知也的知 编辑:程序博客网 时间:2024/05/20 21:44
1. 数据绑定
1.1 SqlDataSource 设置(详见以前数据绑定)
1.2 点击ASPxPivotGrid,右键,在ASPxPivotGrid任务中-> Choose Data Source选择SqlDataSource1 .
1.3 点击 Fields ,弹出ASPxPivotGrid Fields Editor窗体。选择Retrieve fields,你选择的表所有字段都会列出,然后你可以增删你需要的列。
在Behaviour ->Area中,选择好你的行和列以及统计的数值
ColumnArea: 列
RowArea :行
DataArea :数据值(必须为数字类型)
2. 外观与设计
2.1 头的可见性
ASPxPivotGrid控件提供4个属性去控制field头或者头区域。
ASPxPivotGrid1.OptionsView.ShowRowHeaders=True;
2.2 统计属性设置基于 OptionsView.TatalsLocation
RowTotalsLocation 值有Far,Near
2.3 水平滚动条
OptionView ->ShowHorizontalScrollBar =True
2.4 AspxPivotGrid控件能给你提供个性化的cell展示。
protectedvoidASPxPivotGrid1_CustomCellStyle(objectsender,DevExpress.Web.ASPxPivotGrid.PivotCustomCellStyleEventArgse){
if(e.ColumnValueType==PivotGridValueType.Total||e.RowValueType==PivotGridValueType.Total)
//设置统计的颜色
e.CellStyle.BackColor=Color.FromArgb(213,227,230);
}
3. 统计
3.1 单独统计
AspxPivotGrid自动为每行或者每列进行统计。同样统计可以自动计算每组的值
OptionsView 属性中有
ShowRowTotals 、ShowRowGrandTotals
ShowColumnTotals、ShowColumnGrandTotals
3.2 Top
对于列值或者行值,你可以特别的设计去展示多少条记录和计算统计值
数据->TopValueCount = Number
3.3 统计排序
Height :排序值
Category:统计字段
PivotGridField selField = pivotGrid.Fields["Height"];
if (selField ==null)return;
selField.CellStyle.Font.Bold =true;
pivotGrid.Fields["Category"].SortBySummaryInfo.FieldName = selField.FieldName;
pivotGrid.Fields["Category "].SortBySummaryInfo.SummaryType = selField.SummaryType;
3.4
4. 数据导出
ASPxPivotGridExporter1.ExportPdfToResponse(fileName,saveAs);
ASPxPivotGridExporter1.ExportXlsToResponse(fileName,saveAs)
ASPxPivotGridExporter1.ExportMhtToResponse(fileName,saveAs)
ASPxPivotGridExporter1.ExportRtfToResponse(fileName,saveAs)
ASPxPivotGridExporter1.ExportTextToResponse(fileName,saveAs);
5. 自定义过滤字段
if (!IsPostBack && !IsCallback) {
PivotGridField field = ASPxPivotGrid1.Fields["fieldgroupDesc"];
// Locks the control to prevent excessive updates when multiple properties are modified.
ASPxPivotGrid1.BeginUpdate();
try {
// Clears the filter value collection and add two items to it.
field.FilterValues.Clear();
field.FilterValues.Add("A");
field.FilterValues.Add("B");
// Specifies that the control should only display the records
// which contain the specified values in the Country field.
field.FilterValues.FilterType = DevExpress.XtraPivotGrid.PivotFilterType.Included;
}
finally {
// Unlocks the control.
ASPxPivotGrid1.EndUpdate();
}
}
- ASPxPivotGrid 属性
- ASPxPivotGrid CollapseAll 方法为什么不起作用
- 如何提高ASPxPivotGrid的性能
- ASPxPivotGrid导出pdf中文乱码
- 10个devexpress ASPxPivotGrid常见问题
- Devexpress ASPxPivotGrid 按某列排序,以及把GrandTotal修改掉
- ASPxPivotGrid中使用CustomCellDisplayText后,用ASPxPivotGridExporter导出XLS等时,自定义的值为0或空的解决。
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- 属性
- IOS开发之---static变量
- Qt中通过设置位图掩码生成异形控件
- Hdu 4517 小小明系列故事——游戏的烦恼
- 如何快速建立用户信任感
- ubuntu中打开终端的方法
- ASPxPivotGrid 属性
- static在oc中的使用
- C# - 函数参数的传递
- 西游记倒过来看其实更精彩
- C++ MAP类型
- Virtual Box 中安装Cent OS时出现不能进入图形界面
- c语言限制访问链表元素的一种机制
- 企业级系统的认证与授权设计
- 虚拟机系统与宿主机共享上网设置