FernandoPaiva FernandoPaiva - 1 year ago 216
C# Question

How to format number into reportviewer?

I'm trying format a number into ReportViewer. I want the number has the format

. To do this I'm trying use the format property of TextBox but still haven't success. How could I do this ?


=FormatNumber(Fields!terminal.Value, String.Format("{0:000}"))

Answer Source

The function FormatNumber is not going to do that for you.

Instead use the following expession in your TextBox

= Right("000" & Cstr(Fields!terminal.Value),3)

This will convert your value to a string, then add to the front 3 zero's and then return the last 3 chars of that string.

Don't set the Format property of the textBox.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download