Sum total of column ?

Stimulsoft Reports.NET discussion
Post Reply
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Sum total of column ?

Post by ymc »

Hi,
I have a problem on sum up a column which the values in it was generated out by if condition.
i.e. In one databand I have 3 column called a,b,c..and the 4th column called d is generate out by the condition:
{IIF(c != 0 , c, IIF(b != 0, b, a))}
thus, how can I sum up the total of column d and put it in the footer?
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Sum total of column ?

Post by mace242 »

ymc wrote:Hi,
I have a problem on sum up a column which the values in it was generated out by if condition.
i.e. In one databand I have 3 column called a,b,c..and the 4th column called d is generate out by the condition:
{IIF(c != 0 , c, IIF(b != 0, b, a))}
thus, how can I sum up the total of column d and put it in the footer?
Could you not create a calculated decimal Column for the condition such as System.Convert.ToDecimal(IIF(c != 0 , c, IIF(b != 0, b, a))) then add a summary for that?

I'm thinking you're using decimals in the above example - you may have to change that to the type (integer, etc)
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Sum total of column ?

Post by Vital »

Please, try following code:

Code: Select all

{Totals.Sum(datasource, IIF(c != 0 , c, IIF(b != 0, b, a))}
Thank you.
Post Reply