Sum with condition in Footer Band

Stimulsoft Reports.NET discussion
Post Reply
MARIMUTHU K
Posts: 101
Joined: Wed Jul 26, 2006 8:03 am
Location: CHENNAI-TN, INDIA

Sum with condition in Footer Band

Post by MARIMUTHU K »

Hi Savin,

We are using StimulReport.
Now , we are developing one report with conditions based total.

Short Term=if( Age>=12)
e.Value=" "+(dtReport2.PLOT_UNITS * (dtReport2.DET_TRADES_PURCH_REDEEM_PRICE -decimal.Parse(dtReport2.cindexed_cost)));
else
e.Value="0";

Long Term=if( Age>=12)
e.Value="0";
else
e.Value=" "+(dtReport2.PLOT_UNITS * (dtReport2.DET_TRADES_PURCH_REDEEM_PRICE -decimal.Parse(dtReport2.cindexed_cost)));


Page 1


Short Term Long Term

Databand1

1234
221
12
-----------
Footer 14 6 7




Page 2


Short Term Long Term

Databand1
1234
221
12
-----------
Footer 14 6 7


Page 3

Short Term Long Term

Databand1
1234 9
221 11
12
----------- -------------
Footer 14 6 7 20



How to do? How is solve this Problem?

I am try colSum() also.

Please Provide quick solution or use other way.



Thanks of Advance.


Regards,
KMarimuthu.
Acsys.
Marimuthu K
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Sum with condition in Footer Band

Post by Edward »

Please declare string variable VariableTotals and add to it values in BeforePrint Event of the StiText Component

Code: Select all

VariableTotals = VariableTotals + ToString((dtReport2.PLOT_UNITS * (dtReport2.DET_TRADES_PURCH_REDEEM_PRICE -decimal.Parse(dtReport2.cindexed_cost))));
In the Footer Band of the Report you should place StiText with the following expression:

Code: Select all

{VariableTotals} {SumDIf((dtReport2.PLOT_UNITS * (dtReport2.DET_TRADES_PURCH_REDEEM_PRICE -decimal.Parse(dtReport2.cindexed_cost))),Age>12)}
Thank you.
Post Reply