cancel
Showing results for 
Search instead for 
Did you mean: 

RUN TIME data generation

Former Member
0 Kudos

Hi Every one,

According to my scenario i have one standard application which is getting data from backend in the Run time .... Inthis i have table which is having 5 colunms in that we have a column name AVG value for this column we need total avg value below that column..

Can you please tell me the code required to generate the avg value of the total column in Runtime

Thanks

Kirankumar.M

Edited by: kiran kumar on Sep 7, 2008 2:23 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kiran,

Try this Code.

int sum = 0,avg = 0;

for(int i=0;i<wdContext.node<Your Node Name>.size();i++)

{

sum = sum + wdContext.node<Your Node Name>().get<Your Node Name>ElementAt(i).get<Value>();

}

avg = sum/wdContext.node<Your Node Name>.size();

With Regards,

Roop Kumar.

Former Member
0 Kudos

Try this code:-

IPrivate<Your Viwe>.I<YOUR NODE>Node empNode = wdContext.node<YOUR NODE>();

IPrivate<Your Viwe>.I<YOUR NODE>Element empElment = empNode.current<YOUR NODE>Element();

for (int i=0;i<wdContext.node<YOUR NODE>.size();i++){

empElment=empNode.get<YOUR NODE>ElementAt(i);

Sum=empElment.get<VALUE>

}

AVG = Sum/wdContext.node<YOUR NODE>.size

........................................

Regards

-Sandip