Reputation: 172
i have problem in crystall report,
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;
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
============================================================
I use all this code, but in Sum_Cumm_Sum:=Sum_Cumm_Sum+{@getIP}
, I can't get the right value.
Here is my report view:
https://i.sstatic.net/CSmsB.png
Upvotes: 0
Views: 26446
Reputation: 26262
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.
A better approach:
{#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}
Upvotes: 0
Reputation: 9101
To the extent I see as you placed in detail section your formula is working correctly, Now you want to see the summation of values in footer then you need to write saperate formula to sum index....
in footer section so that it sumarizes it saperatley.
Upvotes: 0