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

ShowColumnTotalsShowColumnGrandTotals

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();

                }

            }

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 绑定银行卡的手机号不用了怎么办 oppo账号密码忘了怎么办 魅族账号密码忘了怎么办 苹果手机账号密码忘了怎么办 oppo手机账号密码忘了怎么办 华为手机账号密码忘了怎么办 vivo手机账号密码忘了怎么办 金立s9密码忘了怎么办 手机密号忘了怎么办 qq号忘了账号怎么办 推特密码忘了怎么办 沃邮箱改密码短信延迟怎么办 被qq好友拉黑了怎么办 网易邮箱字体变小了怎么办 邮箱注册不了全拼怎么办 家用电器接入两相火线后怎么办 手机充电板坏了怎么办 闪电宝商户乱跳怎么办 网易邮箱发错了怎么办 苹果手机邮件无法连接服务器怎么办 好记星平板电脑开不了机怎么办 邮箱里的文件过期了怎么办 小米手机邮件发不了怎么办 有人加我qq邮箱怎么办 文件太大发邮件太慢怎么办 爱又米发信息怎么办 手机上电子邮件己停止运行怎么办 苹果电子邮件密码忘了怎么办 玩游戏时电脑烫怎么办 qq邮箱独立密码忘记了怎么办 qq邮箱中转站容量不足怎么办 qq邮箱忘记密码了怎么办 qq邮箱超大附件过期怎么办 忘记qq邮箱独立密码怎么办 网易邮箱账号忘了怎么办 微信登录密码忘了怎么办 微信太久没登录登录不上怎么办 邮箱独立密码忘记了怎么办 苹果设置id没有邮箱怎么办 苹果手机设置id没有邮箱怎么办 邮箱的附件过期了怎么办