Sum Method

Stimulsoft Reports.NET discussion
Post Reply
low1988
Posts: 2
Joined: Thu Dec 13, 2012 9:31 am

Sum Method

Post by low1988 »

I got a statement like this:

if (Sum(Data1,Total) == 0.00) {
this.Text271.Enabled = false;
this.Text272.Enabled = false;
this.Text273.Enabled = false;
}

This statement is use to hide 3 Sti Text if the total value of field "Total" reside in the "Data1" databand is 0.00.
However, an error was occured mentioned "Operator '==' cannot be applied to operands of type 'decimal' and 'double' "
Any idea to deal with it?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Sum Method

Post by Alex K. »

Hello,

Please try to use the following code:

Code: Select all

if (Sum(Data1,Total) == 0) {
this.Text271.Enabled = false;
this.Text272.Enabled = false;
this.Text273.Enabled = false;
}
Thank you.
low1988
Posts: 2
Joined: Thu Dec 13, 2012 9:31 am

Re: Sum Method

Post by low1988 »

Thanks for your reply. The aforementioned error does not occur, but it does not solve my problems too. This is what i want:

-------------------------------------------------------
Group Department A Header
-------------------------------------------------------
---------------------------------------------
DataBand1
---------------------------------------------
columnSalary1
columnSalary2
----------------------------------------------
--------------------------------------------------------
Group Department A Footer

TotalColumnSalary1

--------------------------------------------------------

**********Details of the column************

TotalColumnSalary1.Text = {Sum(DataBand1,DycolumnSalary1)}
TotalColumnSalary1.AfterPrint =

if (Sum(DataBand1,columnSalary1) == 0) {
this.TotalColumnSalary1.Enabled = false;
}



I try to execute the statement by insert it inside the AfterPrint properties of the TotalColumnSalary1, it does not work at all.
The TotalColumnSalary1 contains 0.00 value but does not hide as I expected from the statement.
Any idea with this?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Sum Method

Post by Alex K. »

Hello,

Can you please send us your report with test data for analysis.

Thank you.
Post Reply