表格运行总计,Axe 2009 [英] Form Running Totals, Ax 2009

查看:34
本文介绍了表格运行总计,Axe 2009的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在表格的任何地方是否有在位于网格内的列中执行运行总计的示例.网格的用户排序和过滤会影响运行总计列.

Is there an example anywhere of a form that performs running totals in a column located within a grid. The user ordering and filtering of the grid would affect the running totals column.

如果仅按交易日期排序,我可以轻松执行上述操作,但包括用户排序和过滤,我认为我们必须使用数据源 range()rangecount() 函数(参见 SysQuery::mergeRanges() 示例)然后迭代这些函数以应用过滤,然后包含动态链接.订购也一样,虽然现在更复杂了.

I can easily perform the above if it was ordering only by transaction date, but including the user ordering and filtering I presume that we would have to use the datasource range() and rangecount() functions (see SysQuery::mergeRanges() for an example) then iterate over these to apply the filtering, then include the dynalinks. The same for the ordering, albeit this is now more complicated.

任何建议表示赞赏.任何赞赏建议(如:投票提出问题!).

Any suggestions appreciated. Any appreciations suggested (as in: vote the question up!).

推荐答案

您可以将其实现为 表单数据源使用此策略的显示方法:

  1. 复制表单的数据源查询(不需要SysQuery::mergeRanges):

QueryRun qr = new QueryRun(ledgerTrans_qr.query());

使用 qr 对您的记录进行迭代和求和,在当前记录后停止:

Iterate and sum over your records using qr, stop after the current record:

while (qr.next()){lt = qr.getNo(1);总计 += lt.AmountMST;如果(lt.RecId == _lt.RecId)休息;}

如果排序顺序是固定的(使用 sum(AmountMST) 并添加 where 约束),这可以提高性能.

This could be made more performant if the sorting order was fixed (using sum(AmountMST) and adding a where constraint).

返回总数

这是非常低效的(次二次时间,O(n^2)).

This is of cause very inefficient (subquadratic time, O(n^2)).

如果没有太多记录,缓存结果(在地图中)可能会使其可用.

Caching the results (in a map) may make it usable if there are not too many records.

更新:一个工作示例.

这篇关于表格运行总计,Axe 2009的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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