在动态添加Footer SummaryItem和Group的Item

http://www.delphibbs.com/delphibbs/dispq.asp?lid=2135268

////////////////////////////////////////////////
with tvOrders.DataController.Summary do
  begin
    BeginUpdate;
    try
      with FooterSummaryItems.Add as TcxGridDBTableSummaryItem do
      begin
        Column := tvOrdersPaymentAmount;
        Kind := skSum;
        Format := 'SUM = $,0.00;-$,0.00';
      end;
    finally
      EndUpdate;
    end;
    //Update all open details of the master view (tvCars)
    tvCars.DataController.ClearDetails;
  end;
//////////////////////////////
以上是TcxGridDBTableSummaryItem
但是我在tcxgriddbbandedtableview 中没有反应不显示??
、、、、、、、、、、、、、、、、、、
with tvOrders.DataController.Summary do
  begin
    BeginUpdate;
    try
      SummaryGroups.Clear;
      //The first summary group
      with SummaryGroups.Add do
      begin
        //Add proposed grouping column(s)
        TcxGridTableSummaryGroupItemLink(Links.Add).Column := tvOrdersCustomerID;
        //Add summary items
        with SummaryItems.Add as TcxGridDBTableSummaryItem do
        begin
          Column := tvOrdersPaymentAmount;
          Kind := skSum;
          Format := 'Amount Paid: $,0';
        end;
        with SummaryItems.Add as TcxGridDBTableSummaryItem do
        begin
          Column := tvOrdersPaymentAmount;
          Kind := skCount;
          Format := 'Records: 0';
        end;
      end;
      //The second summary group
      with SummaryGroups.Add do
      begin
        //Add proposed grouping column(s)
        TcxGridTableSummaryGroupItemLink(Links.Add).Column := tvOrdersProductID;
        //Add summary items
        with SummaryItems.Add as TcxGridDBTableSummaryItem do
        begin
          Column := tvOrdersQuantity;
          Kind := skSum;
          Position := spFooter;
          Format := 'TOTAL = 0';
        end;
        with SummaryItems.Add as TcxGridDBTableSummaryItem do
        begin
          Column := tvOrdersPurchaseDate;
          Kind := skMin;
          Position := spFooter;
        end;
      end;
    finally
      EndUpdate;
    end;
  end;
、、、、、、、、、、、、、、、、、、、、、、、、、
group的也一样!
根据如下创建的字段 没有名字
With cxgrid1dbbandedtableview1.CreateColumn do
    begin
     Caption :='月%';
     DataBinding.FieldName:='zpmp' ;
     Position.BandIndex := 4;
     Position.RowIndex := 0;
     //Position.LineCount:=1;
     Visible := True;
showmessage(cxgrid1dbbandedtableview1.CreateColumn.Name);、、、
      end;
从而引起了以上的错误,我想,不知道有没有高手帮忙


从帮助中看到两个例子:、、
、、、、、、、、、、、、、、
procedure TForm1.cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummary
DefaultGroupSummaryItemsSummary(
  ASender: TcxDataSummaryItems; Arguments: TcxSummaryEventArguments;
  var OutArguments: TcxSummaryEventOutArguments);
begin
  if (VarIsNull(OutArguments.Value)) then
    OutArguments.Done := True;
end;
/////////////////////
//Delphi
procedure TForm1.cxGrid1DBTableView1TcxGridDBDataControllerTcxDataSummary
DefaultGroupSummaryItemsSummary(
  ASender: TcxDataSummaryItems; Arguments: TcxSummaryEventArguments;
  var OutArguments: TcxSummaryEventOutArguments);
var
  AArea, APopulation: Extended;
begin
  //Locate a value in the specific record for Area item
  AArea := ASender.DataController.Values[Arguments.RecordIndex, DBTableView1Area.Index];
  //Locate a value in the specific record for Population item
  APopulation := ASender.DataController.Values[Arguments.RecordIndex, DBTableView1Population.Index];
  //Set population density to Value
  OutArguments.Value := APopulation / AArea;
end;
不知道如何取得另一字段的foooter 和更改这一字段的footer 


发现一个example
、、、、、、、、、、、、、、、、、、、
In this example, a summary value is calculated based on the results of other two summaries.  The TcxDataSummary.OnAfterSummary event, which occurs when all summaries are already calculated, is used to calculate a new summary.
Let us examine a table that represents information from the pricelist containing three columns: VendorNo, Description, ListPrice.  We want to group data by vendor and calculate three summaries: the summary that displays a sum of the ListPrice column values, the summary representing the number of goods supplied by a specific vendor and the summary that displays the average value of the ListPrice column values.  Though it is possible to create an average summary by specifying its skAverage type, we will calculate it based on two other summary values and format it in a specific manner.  
The Initialize procedure groups data by vendor and creates three summaries.  The third summary is of the skNone type.  It is substituted for the average summary in MyAfterSummary (the OnAfterSummary event handler).
//Delphi
procedure TForm1.Initialize;
var
  ASummaryItem: TcxDataSummaryItem;
begin
  //group by vendor
  DBTableView1VendorNo.GroupIndex := 0;
  DBTableView1VendorNo.Visible := False;
  with DBTableView1.DataController.Summary do
  begin
    BeginUpdate;
    try
      //set prefix and postfix for a group capion
      DefaultGroupSummaryItems.BeginText := '{';
      DefaultGroupSummaryItems.EndText := '}';
      //summary on ListPrice
      ASummaryItem := DefaultGroupSummaryItems.Add;
      ASummaryItem.Kind := skSum;
      ASummaryItem.ItemLink := DBTableView1ListPrice;
      ASummaryItem.Position := spFooter;
      //summary on Description
      ASummaryItem := DefaultGroupSummaryItems.Add;
      ASummaryItem.Kind := skCount;
      ASummaryItem.ItemLink := DBTableView1Description;
      ASummaryItem.Position := spFooter;
      //dummy summary on Description
      ASummaryItem := DefaultGroupSummaryItems.Add;
      ASummaryItem.Kind := skNone;
      ASummaryItem.ItemLink := DBTableView1Description;
      //subscribe to the OnAfterSummary event
      OnAfterSummary := MyAfterSummary;
    finally
      EndUpdate;
    end;
  end;
end;
procedure TForm1.MyAfterSummary(ASender: TcxDataSummary);
var
  AChildDataGroupsCount: Integer;
  AChildDataGroupIndex, AParentDataGroupIndex: TcxDataGroupIndex;
  AChildPosition: Integer;
begin
  //iterate through data groups at the level 0
  AParentDataGroupIndex := -1;
  with DBTableView1.DataController.Groups do
  begin
    AChildDataGroupsCount := ChildCount[AParentDataGroupIndex];
    for AChildPosition := 0 to AChildDataGroupsCount - 1 do
    begin
      //data group index of a child
      AChildDataGroupIndex := ChildDataGroupIndex[AParentDataGroupIndex, AChildPosition];
      CalculateGroupAverage(AChildDataGroupIndex);
    end;
  end;
end;
procedure TForm1.CalculateGroupAverage(ADataGroupIndex: TcxDataGroupIndex);
var
  AVarSum, AVarCount, AVarAverage: Variant;
begin
  with DBTableView1.DataController.Summary do
  begin
    //get sum of prices for specific data group
    //the second argument identifies a summary index in the
    //TcxDataSummary.DefaultGroupSummaryItems collection
    AVarSum := GroupSummaryValues[ADataGroupIndex, 0];
    //get records count in a group
    AVarCount := GroupSummaryValues[ADataGroupIndex, 1];
    if not (VarIsNull(AVarSum) or VarIsNull(AVarCount)) then
    begin
      AVarAverage := AVarSum / AVarCount;
      GroupSummaryValues[ADataGroupIndex, 2] := Format('%m / %d = %m', [Double(AVarSum), Integer(AVarCount), Double(AVarAverage)]);
    end;
  end;
end;

转载于:https://www.cnblogs.com/railgunman/archive/2011/01/02/1924110.html

BSW: Dcm模块配置--28服务 这个章节讲解下UDS中的28服务(Communcation Control)的配置,顾名思义,对当前ECU的通讯状态进行变更,主要设置应用报文,网络管理报文的收发控制,通常应用在刷写APP软件时,降低总线负载。这里首先要提醒的一点是,28服务几乎不需要手写代码,只有在客户需求要求前置条件不满足时报特定NRC时才需要填充代码。实际配置中主要涉及的模块有DCM,BSWM,ComM,RTE.2.BswM模块的配置。3.ComM模块的配置。1.DCM模块的配置。 阅读详情

相关推荐

华为鸿蒙系统也能用!5分钟搞定谷歌三件套安装(附最新APK下载链接)

本文为华为鸿蒙系统用户提供了一份详尽的谷歌三件套(Google Play服务、商店及框架)手动安装指南。文章核心在于无需Root,通过ADB命令获取设备信息,并从可靠来源下载匹配版本的APK,按照正确顺序安装,从而解决海外应用依赖问题,实现5分钟快速部署。

c7d8e9的博客 6590

cxgrid使用的方法 -2010-1

cxgrid使用的方法

SeekMyself的专栏 2015

OpenClaw实操:给网站装上“智能眼睛”?手把手教你用OpenClaw实时监控网站

本文介绍如何在Windows系统使用OpenClaw构建智能网站监控助手。手把手教你通过配置本地AI模型,让openclaw构建的ai助手自动检测指定网页的内容变化,理解更新重要性,并及时通过邮件、微信、Telegram等渠道发出预警,让你第一时间掌握关键信息,彻底告别手动刷新。

plawuyue的博客 2165

dev 利用summary item实现统计效果

column.summaryitem.summarytype = summaryitemtype.sum (可取count,aversge, sum, max,min,custom, none )column.summaryitem.displayformat =“TOTAL:{0:n3}”显示小数点后三位。dev 利用summary item实现统计效果。4.两统计列添加到gridview 中。5.图中展示两用添加统计列的方法。3.设置统计列的显示格式。2.设置统计列的类型。

A_nanda的博客 657

STM32CubeMx+stm32f407+FreeRTOS+LAN8720实现LWIP以太网UDP TCP数据收发功能

单片机实现LWIP的调试

qq_40600203的博客 3075

从帧结构到数据解析:深入理解CJ/T 188 MBUS水表通信协议

本文深入解析CJ/T 188 MBUS水表通信协议,从帧结构到数据解析提供完整指南。通过典型报文示例和实战案例,详细讲解地址域、控制码、数据标识符(DI)等关键字段的解析技巧,并分享校验算法与常见错误排查方法,帮助开发者快速掌握MBUS协议在水表通信中的应用。

weixin_28710999的博客 425

cxGrid合计忽略重复记录

【属性设置】 1.cxGrid1DBBandedTableView1.OptionsView.FooterMultiSummaries = True;   //如果为False时Footer就只能显示一行 2.双击cxGrid在弹出窗口的Summary页签, 加上要合计的Item并设好各个Item的Column、Format和Kind属性。 如下图 【代码部份】 uses

chelen_jak的专栏 2619

30、航空公司调度问题的数学模型解析

本文详细解析了航空公司调度问题中的核心数学模型,包括航班时刻表生成、机组人员排班和飞机调度的建模方法与求解技术。通过定义变量、约束条件及目标函数,结合线性规划、整数规划等方法,帮助航空公司实现高效调度。文章还探讨了模型的优化策略、简化方法以及实际应用案例,为提升航空运营效率提供了理论支持和实践指导。

beer8的博客 259

cxGridDBTableView用代码创建页脚合计

创建页脚合计提供的设计器中可以很好的完成,但是

悟影的专栏 1831

功能安全实战系列07-英飞凌TC3xx电源监控开发详解

本文对电源监控(PBIST及MONBIST)开发介绍,步骤详细配合开发中的测试情况,图文并茂,方便理解。

initiallizer的博客 1111

16、TFT-LCD 1.8寸显示屏使用

1.8寸TFT-LCD显示屏,简单来说就是用来显示东西的显示器,跟之前的oled1315显示屏的作用是一样的,今天我们就来使用TFT显示屏显示一些内容。1.8寸TFT-LCD显示屏,简单来说就是用来显示东西的显示器,跟之前的oled1315显示屏的作用是一样的,今天我们就来使用TFT显示屏显示一些内容。这块显示屏在淘宝就可以买得到,驱动版本是ST7735S,这里圈住,一会要考的。

繁星点点~ 6768

delphi中cxGrid使用技巧

1. 去掉cxGrid中台头的Box 解决:在tableview1的ptionsview的groupbybox=false; 2.统计功能 解决:(1) tableview tableview1的optionsviewfooter=ture 然后在cxGRid1的customize..中的summary 的footer.add需要合计的列kind= skSum 在Footer的第一列显

小虾米的专栏 3067

十、Teigha.Net示例的源代码下载链接,以及英文的chm说明文件和相关案例

目录官方案例demo下载Teigha.net 英文版手册下载Teigha.net Entity实体中文翻译Teigha4.0 解决闪烁问题demo下载Teigha4.0 收录demo案例类似CAD看图王软件无AutoCAD环境下操作显示CAD文件的功能源码,整个示例模块源码 官方案例demo下载 在之前找到的官方案例3_03版本中包含32位与64位dll 其中的chm的说明文件内容也不完全,后面有更为详细的英文版的chm; 示例项目中,主要包括一个winfrom程序与控制台程序,OdWriteExMgd

... 3522

python如何统计累计每日的人数‘’_如何通过数据,发现有多少人和你一样期待复联4?...

复联四首映,不知道你是高价购票、熬夜观看党,还是屏蔽同好、拒绝剧透党?电影热映,是否能够知道有多少人跟我一样买了票,跟我一样等着看灭霸挨打?是的,我们可以通过例如Lookalike算法,在一个数据集中找到跟我有同类爱好的人群,而在此之前,我们需要先做好数据准备。这篇文章的目的是手把手教会此前没有任何编程基础的同学做数据准备。所谓数据准备,是指通过一系列操作,如分组、求和、替换、拆分、合并...

weixin_39786341的博客 1437

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

C# Dev GridView 分组列(GroupSummary)显示样式的设置

最近使用 DevPress

shuaishifu的专栏 2万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Group Summary Items Page Group Summary Items 页面

网格视图及其后代提供了摘要功能,该功能允许显示已针对所有行或仅行组计算的聚合函数的值。若要计算和显示行组的摘要值,需要将组摘要项添加到 View 的 GridView.GroupSummary 集合中。各统计项目指定统计函数的种类、用于计算的值的字段、统计值是显示在组页脚单元格中还是显示在组行中等。设计器的 Group Summary Items 页面提供对组摘要项集合的访问,并允许自定义各个项目的设置。的 Add 按钮创建一个新的摘要项并将其附加到集合中。所选项的设置将显示在属性网格中。

龙七 353

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

Devexpress 学习

***********************************绑定下拉框**********************************  ///         /// Devxpress LookupEdit自定义绑定         ///         ///  lookupEdit         ///  数据源          ///  Memb

yuan_jie 3164

delphi CxGrid使用小结

激活内置编辑控件 1) .Controller.EditingController.ShowEdit();  2) .Controller.EditingController.StartEditShowingTimer();  3) .Controller.EditingItem := ;  4) .Editing := True; 隐藏内置编辑控件  .Controller.Edit

wozengcong的专栏 1979

Summaries

组摘要(GridGroupSummaryItem)是在各个组上计算的,并显示在组页脚区域或组行中。

龙七 507

dev gridcontrol summaryitem如何加条件_JavaScript 优化判断条件

一、前奏:我们一般在遇到复杂逻辑判断时,第一时间想到的处理方案是用if/else/switch等来实现多个条件判断逻辑处理,但是随着判断条件的增多,代码中的判断条件会越来越来越臃肿,越来越不可读不可维护,下面探讨如何更优雅的写判断逻辑。1、if/else方式: 如键盘按键 const publicKeyboardShortcuts = (evt: KeyboardEvent) =&gt...

weixin_36398921的博客 319

Summaries 总结

汇总总数 (GridSummaryItem) 将针对所有数据网格记录进行计算,并显示在视图页脚中。启用 View 的 OptionsView.ShowFooter 设置以显示视图页脚。组摘要 (GridGroupSummaryItem) 是针对单个组计算的,并显示在组页脚区域或组行中。当视图页脚可见时,最终用户可以右键单击它,并使用上下文菜单添加和删除摘要项。还可以右键单击现有摘要以更改其聚合函数。

龙七 1100

GridControl页脚显示列的汇总数据

gridView4.OptionsView.ShowFooter = true;//启用显示页脚 //索引为1的列 gridView4.Columns[1].SummaryItem.DisplayFormat = "{0:0.##}"; gridView4.Columns[1].SummaryItem.FieldName = "TotalMoney...

qq_18932003的博客 1338

DevExpress GridView.CustomSummaryCalculate 实现自定义Group Summary

--首发于博客园,转载请保留链接博客原文 DevExpress Documentation官方地址:GridView.CustomSummaryCalculate Event 1. 概要 界面上 GridView 显示的数据里某些字段在读出来的时候已经 SUM By FieldA ,在界面上统计时就不能简单累计总和,条件是 FieldA 相同不能重复相加。 2. 问题 vie...

weixin_33912638的博客 857

DevExpress GridControl SummaryItem的Custom Summary

转自:http://blog.vsharing.com/janezhangxy/A1453525.html 使用DevExpress GridControl 时,有一栏为colSelected(FieldName 为"Selected") ,需根据此栏是否选中来计算另外一栏colCurrentApplyQuantity(FieldName 为"CurrentApplyQuanti

threadroc的专栏 5580

TCXGRID控件常用属性介绍

TCXGRID控件: 属性: ActiveLevel: 当前层 BorderStyle: 窗口风格 Color: 颜色 FocusedView: 当前View; Font: 字体 LevelTabs: 类似PageControls头设置   CaptionAlgnment:标题对齐方式   Images:图标   Style:风格 Levels: RootLevelOpti

wozengcong的专栏 3752

cxgrid动态生成footersummary 并获得值

var f: TcxGridDBTableSummaryItem; cx_for_mctv.OptionsView.Footer := true; //cxGrid1DBTableView1.OptionsView.Footer := True; f := (cx_for_mctv.DataController.Summary.FooterSumma...

weixin_34417635的博客 407
上一篇: Delphi和C++指针详解
下一篇: 鼠标双击消息
aowo7144
博客等级 码龄10年 5粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值