I have a negative value from the sum, and I need an absolute value. FYI value is in the label.
The label that is used for the amount has a SummaryCalculated event .
private void xrLabel1_SummaryCalculated(object sender, TextFormatEventArgs e) { xrLabel1.Text = Math.Abs(Convert.ToInt32(e.Value)).ToString(); }
You just need to use the Math.AbsMethod
Math.Abs
Returns the absolute value of the specified number.
For instance:
string s = YourLabelControl.Text; int i; if(Int32.TryParse(s, out i)) { int abs = Math.Abs(i); } else { //Your Label value is not a valid int. }