Results 1 to 4 of 4

Thread: SSRS formatting numbers

  1. #1
    Join Date
    Mar 2009
    Posts
    49

    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. #2
    Join Date
    Apr 2008
    Posts
    1,948

    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. #3
    Join Date
    Apr 2008
    Posts
    2,005

    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. #4
    Join Date
    May 2008
    Posts
    2,297

    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)
    See if it works for you....!

Similar Threads

  1. How to change negative numbers to positive numbers in Excel
    By Shaina Na in forum Microsoft Project
    Replies: 3
    Last Post: 08-01-2012, 05:35 PM
  2. Project Server 2007 and SSRS
    By Poonam_YC in forum Networking & Security
    Replies: 1
    Last Post: 13-09-2010, 06:45 PM
  3. Implementing SSRS in Silverlight 4
    By Obama P in forum Software Development
    Replies: 5
    Last Post: 05-08-2010, 09:29 AM
  4. Need C program code to count numbers of negative & positive numbers
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 16-01-2010, 02:00 PM
  5. SQL Query for Searching Missing Numbers from Sequence of Numbers
    By Bhagwandas in forum Software Development
    Replies: 3
    Last Post: 18-02-2009, 01:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,027,129.48146 seconds with 17 queries