on 09-07-2008 1:23 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
11 | |
11 | |
10 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.