SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


format related problem in SSRS: to show upto # decimal places


format related problem in SSRS: to show upto # decimal places

Author
Message
nayak.shridevi
nayak.shridevi
SSC-Enthusiastic
SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 Visits: 131
IN REPORTING SERVICES (SSRS)

The expression in a cell is like
=Sum(Fields!a.Value)/Sum(Fields!b.Value)

in output .. i want to show upto 5 decimal places.

Is this possible with a format string?? or any other solution??
Jason Hall
Jason Hall
Mr or Mrs. 500
Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)Mr or Mrs. 500 (514 reputation)

Group: General Forum Members
Points: 514 Visits: 82
If you only want 5 decimal places to show up you can use the following as your format string.

#.#####

The pound sign indicates that only 5 numbers should be shown after the decimal. If you always want 5 decimal places to show even for integers you can use zero's instead of pound signs.

For example if you use #.##### as your format string , and the value is 5 it will display as 5.

If the value is 5 and you use #.00000 as your format string, it will display as 5.00000.

Please let me know if this helps.
Niraj-627298
Niraj-627298
Mr or Mrs. 500
Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)

Group: General Forum Members
Points: 503 Visits: 719
Hello...

Please try this once and let me knw if it helps...

=Format(Sum(Fields!a.Value)/Sum(Fields!b.Value),"#.#####");

Thanks,
nayak.shridevi
nayak.shridevi
SSC-Enthusiastic
SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 Visits: 131
this is a partial solution... thanks

But if the value is calulated to "0"... then nothing is displayed in that cell
where as output expected is "0.00000"

similarly ... if the value is calculated to "0.123456789" .... then the output expected is "0.12345" .... and "#.#####" displays it as ".12345"
Glen Sidelnikov
Glen Sidelnikov
Right there with Babe
Right there with Babe (755 reputation)Right there with Babe (755 reputation)Right there with Babe (755 reputation)Right there with Babe (755 reputation)Right there with Babe (755 reputation)Right there with Babe (755 reputation)Right there with Babe (755 reputation)Right there with Babe (755 reputation)

Group: General Forum Members
Points: 755 Visits: 804
# - specifies an optional placeholder
0 - specifies required placeholder

Format(Table!Field.Value,"#0.00000")

will always return 5 digits after comma.
nayak.shridevi
nayak.shridevi
SSC-Enthusiastic
SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 Visits: 131
thanks Glen Sidelnikov Smile

"#0.00000" worked!! BigGrin
Niraj-627298
Niraj-627298
Mr or Mrs. 500
Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)

Group: General Forum Members
Points: 503 Visits: 719
My pleasure....

You can try this...

=IIf((Field!val1.Value/Field!val2.Value)>0,Format((Field!val1.Value/Field!val2.Value)),"#0.00000"),"0.00000")

..Let me knw...if it works..

Thanks...
shilpareddy2787
shilpareddy2787
SSC-Enthusiastic
SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)SSC-Enthusiastic (116 reputation)

Group: General Forum Members
Points: 116 Visits: 66
Hello,

You can directly Format the TextBox as "N5", then you can get the 5 decimal places for the Number.

Hope this helps
vijayp.net
vijayp.net
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 13
Thanks, Shilpa..
thats better option to format the textbox to display result upto 5 decimal places
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search