0

I tried to search this problem and unlucky to solve.

I have a generated report using the rdlc, now, I want to sum all the positive numbers not including the negative in rdlc coding way.

     Credit
     ------
          3
          3
          3
          3
          3
          3
          2
         -3
         -2
     ------
Total:   20

So, the main point is ignore the negative and sum the positive numbers. so far this what I have tried and this not the solution of my problem.

=IIF(Fields!creditUnit.Value > 0, Sum(Fields!creditUnit.Value), 0)

Anybody can help me?

UPDATE:

This was my temporary solution, since my generated report is good for only one page. I create a parameter for Total

var total = creditsList.Where(c => c.HasValue && c.credit > 0).Sum(c => c.credit.Value);
var totalParam = new ReportParameter("total", total);

I hope that one of you guys can help me in what would be the solution in rdlc coding way to sum all the positive numbers.

UPDATE:

I included the because the way the coding of rldc is VB syntax.

4

2 に答える 2

0

試す

=Sum(IIF(Fields!creditUnit.Value > 0, Fields!creditUnit.Value, 0))
于 2013-06-03T18:18:51.963 に答える