Groups | Blog | Home
all groups > sql server reporting services > january 2007 >

sql server reporting services : Percentages are rounding and I don't want them to


jp
1/31/2007 9:49:01 AM
Using SQLRS 2005
No matter how I format the percentage (using FormatPercent or "P" format
option, my text box in a table control rounds the percentage to a whole
percentage with zeroes in the decimal columns.

I don't want it to round off at all.

Any pointers?
--
Kerrie
1/31/2007 1:28:01 PM
[quoted text, click to view]

I am not sure this will help but...
Leave the formatting alone and just use the expression builder

In database column (lets call is percentField), number is like this...

123.456789 then in expression builder '=Fields!percentField.Value +
"%" ' - field should look like 123.456789% on the report.
..123456789 then in expression builder '=(Fields!percentField.Value
*100) + "%" ' - field should look like 123.456789% on the report.

I hope that is what you were talking about and I hope that helps you.

Thanks and have a great day,
Kerrie
jp
1/31/2007 2:01:00 PM
Thank you very much for taking the time to respond.

I tried eliminating the formating as you suggested. And I now have
=Fields!JulPercentage.Value * 100 & "%" as the expression but it is still
taking a value like .026436346 (confirmed by looking at the result set in the
Data tab) and making it 3.00% in the table control on the report.

--
John Shahan


[quoted text, click to view]
Rowen
1/31/2007 3:33:01 PM
[quoted text, click to view]

You can specify the number of decimal places you would like to see in
the percentage, using the
FormatPercent(number, DecimalPlaces) function. However, this will show
zeros if the percent is a whole number. If you want sometimes to show
decimal places, but to show no trailing zeros, then you probably need
to construct the number manually (division, then multiply by 100) and
add the % sign on the end as a string.

Rowen
Kerrie
2/1/2007 5:20:44 AM
[quoted text, click to view]

I would definitly try Rowan's suggestions, but what do you have the
format as on the table for that field? Something is set and it needs
to be turned off. I would leave it on 'General' or 'g' on the format
property.

Kerrie
AddThis Social Bookmark Button