|
| |||||||||
| Tags: format, number, report service, sql server, ssrs |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| SSRS formatting numbers
I am making a report where i have to put numbers for showing profit & loss... I am using SQL Server Reporting Services(SSRS). For example : 224308.81 Does anyone know how to do it..???? Please Help....! |
|
#2
| ||||
| ||||
| Re: SSRS formatting numbers
I have made a code for it just put it in the CODE Window... For going into the ODE Windows Firstly go to REPORT then go to REPORT PROPERTIES & then go to CODE Window....! Code: ADD this code there :
Public Function FormatIndian(ByVal Amount As decimal) As String
Dim strAmount As String
Dim strGrpsArr() As String
Dim lngPos As Long
Dim lngIndex As Long
strAmount = Format$(Amount, "#")
If Len(strAmount) < 4 Then
FormatIndian = strAmount
Else
lngIndex = (Len(strAmount) - 2) \ 2
ReDim strGrpsArr(lngIndex)
strGrpsArr(lngIndex) = Mid$(strAmount, Len(strAmount) - 2)
lngPos = Len(strAmount) - 4: lngIndex = lngIndex - 1
Do
strGrpsArr(lngIndex) = Mid$(strAmount, lngPos, 2)
lngPos = lngPos - 2: lngIndex = lngIndex - 1
If lngPos = 0 Then strGrpsArr(0) = Left$(strAmount, 1)
Loop Until lngPos <= 0
FormatIndian = Join(strGrpsArr, ",")
Erase strGrpsArr
End If
End Function After that you need to add the following expression in the text box : Code: =code.FormatIndian(Fields!AMOUNT.Value) |
|
#3
| ||||
| ||||
| Re: SSRS formatting numbers
I think firstly you need to know how to tell the formatting for negative numbers and positive numbers. The formula becomes to be #,##0;(#,##0). The Main key here is semicolon that differentiate positive from negative. It is that the left is positive & right is negative. |
|
#4
| ||||
| ||||
| Re: SSRS formatting numbers
Try this which may help you..... Just try to put the following Expression in Text box : Code: =IIF(Rownumber(Nothing) = 1, N, P2) |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "SSRS formatting numbers" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change negative numbers to positive numbers in Excel | Shaina Na | Microsoft Project | 3 | 08-01-2012 05:35 PM |
| Project Server 2007 and SSRS | Poonam_YC | Networking & Security | 1 | 13-09-2010 07:45 PM |
| Implementing SSRS in Silverlight 4 | Obama P | Software Development | 5 | 05-08-2010 10:29 AM |
| Need C program code to count numbers of negative & positive numbers | Sarfaraj Khan | Software Development | 5 | 16-01-2010 02:00 PM |
| SQL Query for Searching Missing Numbers from Sequence of Numbers | Bhagwandas | Software Development | 3 | 18-02-2009 01:47 PM |