Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format numeric field 1

Status
Not open for further replies.

rose4567

Programmer
Mar 12, 2007
70
US
I have created a report using Reporting Services 2005 and have a question about formatting a numeric field with three decimal places.

I am trying to format a numeric (6,3) field. The data stores in the field like:

1.000
1.250
1.500
0.500

I need to print this field on the report I've created and the customer wishes the information to print in the following format:

1
1.25
1.5
.5

Everytime I've tried to convert or drop the zeros, the number just gets rounded to a whole number. Any suggestions would be greatly appreciated.

Thank you!!
 
In the Format property of your TextBox, make the Format expression as follows:
Code:
="#,#.###"
 
My apologies for not being clearer, here is the code currently in the expression:

=vbcrlf & iif(Fields!req_item_type.Value="I",Fields!print_sequence.Value,"")

Because I need to both the hard return and conditional suppression in the expression.

If I move the conditional suppression to the Visibility property, I loose the left border on the column since it just suppresses the whole table field.

Also, due to one of the customer's other requirements I need to keep the hard return in the expression to work around SSRS's lack of Keep Together functionality (you can only apply keep together or "fit" to an entire table. unlike Crystal where you can apply a keep together on specific report sections).

The format property only works if just the field name is the expression like:
=Fields!print_sequence.Value

Is there another way around this where I can keep the hard return and conditional supression in the expression?
 
You can use the FORMAT function within the expression:

=vbcrlf & iif(Fields!req_item_type.Value="I",FORMAT(Fields!print_sequence.Value, "#,#.###"),"")
 
Oh that is just beautiful. Thank you so much!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top