Answered by:
Display number as percentage in a textbox

Question
-
User-1210839387 posted
using VS.Net 2005
I am returning a number from a stored proc (Numerator/denom) and I would like to display this in a textbox as a percentage. Is there a property to do this or do I just convert this number to a decimal?
thanks
MC
Tuesday, March 13, 2012 12:15 PM
Answers
-
User-8475372 posted
Dear User,
Yes, this can be done at the report level itself. All you need to do is (Num/Den) & "%" in your expression of that textbox.
Appending % symbol.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 14, 2012 1:28 AM
All replies
-
User1732514203 posted
I believe you can do this in .Net 2.0.
textBox1.Text = number.ToString("p");
Hope this helps,
StuartTuesday, March 13, 2012 12:24 PM -
User-1210839387 posted
thanks for feedback.
I'm converting the report in VS.net using a report project but then uploading using SSRS report admin page so I'm not really doing any processing using the VS.Net C# or VB.net, so I'm looking to do this in the report itself
Tuesday, March 13, 2012 12:49 PM -
User1732514203 posted
Sorry, didn't realise this was in the SSRS forum.
I haven't got access to SSRS at the machine I'm on but can you not right-click your textbox > properties > number and then set the format here?
EDIT:Like this (ignoring the bit about negative numbers)
http://www.bidn.com/blogs/kylewalker/ssis/796/additional-formatting-to-percentages-in-ssrs
Tuesday, March 13, 2012 12:59 PM -
User-1210839387 posted
what i'm doing now:
right click textbox and go to properties
click on format tab and elipses
under standard choose percentage
but when I do this I am getting an error:
<ERROR>
the properties for this currently selected item are not valid. Please correct all errors before continuing.
</ERROR>
what errors does that refer to and how do I found out what they are?
thanks
MC
Tuesday, March 13, 2012 1:01 PM -
User-1528094326 posted
What version of SQL Server or RDL are we taking here? 2005? 2008 or 2010?
Is the data in the textbox an expression or is it just pulling from a specified dataset? What type of data is it? A string or is it an actual number or integer data type?
Tuesday, March 13, 2012 7:23 PM -
User-8475372 posted
Dear User,
Yes, this can be done at the report level itself. All you need to do is (Num/Den) & "%" in your expression of that textbox.
Appending % symbol.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, March 14, 2012 1:28 AM