Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Field Expressions in Sql Server Reporting Srevices(SSRS)-2005..

Field Expressions in Sql Server Reporting Srevices(SSRS)-2005..

Scheduled Pinned Locked Moved Database
sql-servercsharpdatabasesysadminhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aswanth
    wrote on last edited by
    #1

    Hi.. I'm Using the following Expression for Division in SSRS-2005 in C# Web Applications.. =Round(((Fields!Price.Value*100)/Sum(Fields!CPU.Value, "DataSet1_AmountDetails")),2) & "%" When I'm Using this Expression i'm getting the Result as i'm expecting .. ie.. 10.25%, 15.45%, 12.14%,..... But the Problem is When i'm adding all the Values it is giving me 102.56%.. But I want to Show the Chart for only 100%.. If i'm not adding this Decimal points i'm getting the Total of 99%.. (ie 10,15,12,.......) What can I do Now for getting the Chart to Show the Result of 100%.. Please give me any Suggestions.. Thank You..

    P 1 Reply Last reply
    0
    • A Aswanth

      Hi.. I'm Using the following Expression for Division in SSRS-2005 in C# Web Applications.. =Round(((Fields!Price.Value*100)/Sum(Fields!CPU.Value, "DataSet1_AmountDetails")),2) & "%" When I'm Using this Expression i'm getting the Result as i'm expecting .. ie.. 10.25%, 15.45%, 12.14%,..... But the Problem is When i'm adding all the Values it is giving me 102.56%.. But I want to Show the Chart for only 100%.. If i'm not adding this Decimal points i'm getting the Total of 99%.. (ie 10,15,12,.......) What can I do Now for getting the Chart to Show the Result of 100%.. Please give me any Suggestions.. Thank You..

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Obviously, if you apply rounding to values and then sum the values the sum of those values may be more/less than 100% (depending on whether the values were generally rounded up or down). The solution is to only apply rounding on the presentation of the numbers by using a format expression. Your actual calculations should work with the original values, so summing the values won't result in rounding errors.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      A 1 Reply Last reply
      0
      • P pmarfleet

        Obviously, if you apply rounding to values and then sum the values the sum of those values may be more/less than 100% (depending on whether the values were generally rounded up or down). The solution is to only apply rounding on the presentation of the numbers by using a format expression. Your actual calculations should work with the original values, so summing the values won't result in rounding errors.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        A Offline
        A Offline
        Aswanth
        wrote on last edited by
        #3

        Then How Can I Solve my Problem ..

        P 1 Reply Last reply
        0
        • A Aswanth

          Then How Can I Solve my Problem ..

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          Aswanth wrote:

          Then How Can I Solve my Problem ..

          Didn't you read my reply? I explained what you need to do. I'm not going to write the code for you - as a professional developer you should be able to do that.

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups