Page 2 of 2

avg in two subreport

Posted: Mon Aug 09, 2010 12:31 pm
by majidsoft
hi
i do your advise but i face with error can you send me a sample
thanks

avg in two subreport

Posted: Tue Aug 10, 2010 1:07 am
by Alex K.
Hello,

Please see the attached report sample.

Thank you.

avg in two subreport

Posted: Thu Aug 12, 2010 8:14 am
by majidsoft
hi
thanks for your attention
my field in my main report is take avg from to variable but i want if on of them have 0 value avg not working and show another number this is my problem
now if any of them face with 0 avg in my main report use it in formula that i dont want it to do that
thanks

avg in two subreport

Posted: Thu Aug 12, 2010 8:58 am
by Alex K.
Hello,

You can use following expression:

Code: Select all

avg={IIF((Avg1==0)||(Avg2==0),"No avg",(Avg1+Avg2)/2)}
Thank you.

avg in two subreport

Posted: Thu Aug 12, 2010 4:21 pm
by majidsoft
hi
thank you but my problem not solved i write my code in programming language please you change it for me
thanks
if avg1=0 or avg2=0 then
if avg1=0 then
avg=avg2
else if avg2=0 then
avg=avg1
end if
else
avg=(avg1+avg2)/2
end if

avg in two subreport

Posted: Fri Aug 13, 2010 12:33 am
by Alex K.
Hello,

Code: Select all

avg = {IIF((Avg1==0)||(Avg2==0),(IIF(Avg1==0,Avg2,(IIF(Avg2==0,Avg1,0)))),(Avg1+Avg2)/2)}
Thank you.

avg in two subreport

Posted: Sat Aug 14, 2010 3:09 pm
by majidsoft
hi
its so beautiful code
thank you

avg in two subreport

Posted: Sat Aug 14, 2010 11:05 pm
by Andrew
We are always glad to help you!