本文介绍了如何在水晶报表中汇总每个组的运行总字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的水晶报告有问题,

这是我在谷歌许多参考网站后的代码,

Here is my code following many reference site in google,

// {@reset}
//place in group header
whileprintingrecords;
global numbervar Sum_Cumm_Sum:=0;

// {@increment}
//place in section detail
whileprintingrecords;
global numbervar Sum_Cumm_Sum:=Sum_Cumm_Sum+{@getIP};

// {@display}
//place in group footer
whileprintingrecords;
global numbervar Sum_Cumm_Sum;

其中 getIP 是公式,

Where getIP is Formula,

{#sumKN}/{#sumSKS}

其中的代码正在运行总字段,在更改组上重置

and code in it is running total field with reset on change group,

{#sumKN} is running total field for field KN
{#sumSKS} = is running total field for field SKS

==============================================================

============================================================

我使用了所有这些代码,但是在 Sum_Cumm_Sum:=Sum_Cumm_Sum+{@getIP} 中,我无法获得正确的值.

I use all this code, but in Sum_Cumm_Sum:=Sum_Cumm_Sum+{@getIP}, I can't get the right value.

这是我的报告视图:

http://i.stack.imgur.com/CSmsB.png

推荐答案

使用手动运行总计或 运行总计字段,不能同时使用.顺便说一句,running-total 字段 仅适用于 footer 部分.

Either use a manual running total OR a running-total field, not both. By the way, a running-total field only works in a footer section.

更好的方法:

{#sumKN} - field is {table.KN}; summarize for all records; reset after change in group

{#sumSKS} - field is {table.SKS}; summarize for all records; reset after change in group

// place in `footer` section
//{@ratio}

// optional
// EvaluateAfter({#sumKN});
// EvaluateAfter({#sumSKS});

{#sumKN} / {#sumSKS}

这篇关于如何在水晶报表中汇总每个组的运行总字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 19:33