Solved

Formatting numbers contained in SSRS charts

Posted on 2010-09-02
4
383 Views
Last Modified: 2012-05-10
Hi,

I want my SSRS chart object to display the sum of one of my data fields in its title. The chart title text is defined as the following expression:
="Days Spent per Category ("
& CStr(Sum(Fields!days_spent.Value)) & " days total)"

Unfortunately this is displayed as:
"Days Spent per Category (66.500000 days total)"
instead of:
"Days Spent per Category (66.5 days total)"

I am already using the SQL ROUND function in the dataset query to ensure days_spent is always rounded to one decimal place, so this is just a presentation issue. Can someone please advise how this number can always be made to present with just one decimal place in my chart legend?

Many thanks.
0
Comment
Question by:irb56
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
planocz earned 250 total points
ID: 33586369
try this
="Days Spent per Category ("
& Sum(Format(Fields!days_spent.Value, "##.#")) & " days total)"
 
0
 

Author Comment

by:irb56
ID: 33586602
Thanks for such a quick response. This is very helpful. When I copied and pasted your code into my report, the chart title displayed "Error" but I quickly worked out that the Format function needs to wrap the Sum function rather than be nested within it. The following expression works perfectly.

="Days Spent per Category ("
& CStr(Format(Sum(Fields!days_spent.Value),"##.#")) & " days total)"

I wouldn't have got to this anything like as quickly without your solution, so much appreciated.
0
 

Author Closing Comment

by:irb56
ID: 33586642
The solution is to use the Format function within the expression as per the expert solution but see my other comment for correction on structure of expression - Format needs to wrap the Sum function not be nested within it.
0
 
LVL 27

Expert Comment

by:planocz
ID: 33586768
I did not have time to test the exact layout, but I knew you would get the idea :)
0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After much searching across the internet I have found that you could not set the name of the file you were attaching to dynamic report subscriptons in Microsoft Reporting Services. I did manage to find one article showing you how your could make a s…
Hi, I have heard from my friends that it’s not possible to create Label Printing report using SSRS. I am amazed after hearing this words not possible in SSRS. I googled lot and found that it is possible to some of people know about the Report Bui…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question