Reputation: 13
In RDLC, One of the column output is 2.099. I want it as 2.09. I've already used Format and FormatNumber Function in RDLC expression. But the output is 2.10. But I need 2.09. How??
I have tried in these ways:
=FormatNumber (Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))),2)
=Format (Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))),"N")
=Format (Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))),"D")
And also changed the Number type in Text box properties. But failed.....
Upvotes: 1
Views: 2614
Reputation: 16
create following custom function under "Report Properties", in code tab:
Public Function WithoutRound(vl As String)
Dim temp As String
temp = FormatNumber(vl, 4)
temp = Left(temp, Len(temp) - 2)
Return temp
End Function
and use it in textbox like
=Code.WithoutRound(Fields!RunningBalance.Value)
Upvotes: 0
Reputation: 432
Use Math.Trucate in your expression, ex:
=Math.Truncate(Sum(Switch((Fields!IsConsiderGPA.Value) = True , (Fields!Credit.Value) * (Fields!GPA.Value) )) / Sum(Switch(Fields!IsConsiderGPA.Value = True , (Fields!Credit.Value))))*100)/100
You can then format the number as you with in the "Number" vertical tab in the text box properties.
Upvotes: 2