问题
i have generated a table below:
No Product A|No Product B|No Product C|No Product D|total Product A+D|total Product B+D
100 50 30 40 ? ?
in my first result, i wish to get the sum of total product A & D, follow by total product B + D, and expression code can sum it accordingly ?
回答1:
Again this is very simple , All you need is two expressions in your columns , it is just adding up two column. like you would do in sql server or any other RDBMS.
Add Two Columns to right of your existing columns and right click the data cell go to expression and use the following expressions to get the desired sum values.
total Product A+D
= Fields!ProductA.Value + Fields!ProductD.Value
total Product B+D
= Fields!ProductB.Value + Fields!ProductD.Value
I am only assuming the names of fields here, you will need to use the field name from your dataset. i.e Fields!YourFieldName.Value
来源:https://stackoverflow.com/questions/23457869/expression-sql-reporting-builder-2008-r2-how-to-sum-specific-field