ssrs Sum many textbox value in footer - reporting-services

Greeting
i have 3 textbox value in footer of my report
i want make total (sum) for tow of them
so when i try to make total with them give me this error
The Value expression for the textrun ‘.Paragraphs[0].TextRuns[0]’ refers to more than one report item. An expression in a page header or footer can refer to only one report item.
i used those code for sum but none of them working
=ReportItems!Textbox62.Value+ReportItems!Textbox61.Value
and this
=CDec(ReportItems!Textbox62.Value)+CDec(ReportItems!Textbox61.Value)
is there any idea fro solve this problem

That depends how your textbox expressions are. Lets assume you have one dataset (Dataset1) then you have
'Textbox1
=Sum(Fields!SomeNumericValue.Value)
'Textbox2
=Avg(Fields!SomeOtherNumericValue.Value)
Then this will work for your other textbox:
'Textbox3
=ReportItems!Textbox1.Value + ReportItems!Textbox2.Value
=Sum(Fields!SomeNumericValue.Value) + Avg(Fields!SomeOtherNumericValue.Value)
If you have two datasets (Dataset1 and Dataset2) this will work:
'Textbox1
=Sum(Fields!NumericValue1.Value, "Dataset1")
'Textbox2
=Avg(Fields!NumericValue2.Value, "Dataset2")
'Textbox2
=Sum(Fields!NumericValue1.Value, "Dataset1") + Avg(Fields!NumericValue2.Value, "Dataset2")

Related

SSRS get value from specific row and column

What I would like to get is the Gross Margin % of the Revised Budget cell (11%) and place in a text box at the top of the page so it stands out a little more.
This is my current dataset output and also what is rendered in the table.
Header
Original Budget
Change Orders
Revised Budget
Contract Value
1000
0
1000
Labor
500
500
100
Gross Margin %
10%
10%
11%
I have tried using some IIF statements but that seems to only pull from the aggregate of the dataset and have looked at the LOOKUP function but that seems to only target a row.
Something I tried that isn't working - doesn't look right anyway
=Fields!Header.Value = "Gross Margin %" and Fields!Revised_Budget.Value = "Revised Budget"
If someone could point me in the direction of the correct function that would be great.
Running SSRS 2012.
Here is the report design
The row you need the value from is a group total, then you should be able to use the ReportItems collection and add a reference to actual textbox.
In your example, click the cell that you want to repeat (the one at the bottom of your report) and find its name from the properties panel, some like TextBox99.
Then in the textbox at the top, set the expression to
=ReportItems!textBox99.Value
That should be it.
I ended up using the Lookup function. The first value is name of the value from the Header column that I was looking for. The last value is the which data I want to return and that is the Revised_Budget value from the ProjectCosts dataset.
=LOOKUP(
"Gross Margin %",
Fields!Header.Value,
Fields!Revised_Budget.Value, "ProjectCosts"
)

SSRS Report Builder 2016 - Calculating Debit and Credit and display to Balance row

Report builder design
Running expression inside FlineBalance properties
Expression inside FlineBlance
This is the result of may table however its wrong
This is the result that i am expecting basically this report is from crystal report and i am trying to convert this in SSRS
What expression should I use?
i tried below expression but it's not successful.
=IIF(Fields!debitAmount.Value > 0,Abs(Previous(Fields!FlineBalance.Value) + Fields!debitAmount.Value),
IIF(Fields!creditAmount.Value > 0,Abs(Fields!debitAmount.Value - Previous(Fields!FlineBalance.Value))
,Abs(Fields!FlineBalance.Value)))
I revise the expression code to FlineBlance to: =IIF(Fields!debitAmount.Value > 0,Abs(Fields!FlineBalance.Value),
IIF(Fields!creditAmount.Value > 0,Abs(Previous(Fields!FlineBalance.Value) -Fields!creditAmount.Value)
,"")) but as you can see the higlighted yellow should be zero.
Try the following for you FlineBalance expression
=RunningValue(Fields!debitAmount.Value, SUM, Nothing) - RunningValue(Fields!cerditAmount.Value, SUM, Nothing)
I have small issues only in the table below my first page. the bottom line its not showing in every page it's appearing only in the last page. kindly advise.
enter image description here

How to subtract two textBoxes of ssrs report?

In footer I have 2 textboxes named curTotal and sub_total.
In header I have third textbox named result.
What I want to do is to subtract values of footer: result = sub_total - curTotal;
curTotal expression is (=sum(reportitems!lineamount1.value))
and
sub_total expression is (=Last(ReportItems!runningTotal.Value))
"runningTotal" is a field in tablix which has expression (=RunningValue(Fields!LineAmount.Value, SUM, "SalesInvoiceDS"))
I have tried to add to result expression following (=reportitems!sub_total.value - reportitems!curTotal.value) but it gives error that textbox refers to several report elements.
Please guide me how to correctly perform Math functions like subtract, multiple, division etc... with textBoxes in footer / header.
Unfortunately you cannot perform operations that combine ReportItems. Therefore the mathematics needs to take place at the appropriate row level using values derived from the data source and the results held in hidden fields at this level that can then be referred to using ReportItems.
So one approach would be to add a dummy outer grouping level to your report with a footer that you use to calculate these values. This footer line can be hidden and used as a source of ReportItems for your footer and possibly your header.
Also see http://www.keepitsimpleandfast.com/2011/09/running-totals-per-page-in-ssrs-to.html

SSRS - Changing tab name when exporting to excel

I have tabbed my report in SSRS 2012 by having my page breaks based upon grouping classname and it works great. How do I change the tab names when exporting to Excel? I tried having an expression for page name =Fields!classname.Value. In doing so, it makes all 4 of my tabs equal the first page break of Sales Division.
My tabs are based upon the grouping of classname, which in returns gives me the 4 tabs: Sales Division, VRS, ClearCaptions, and IP-relay.
You need to set the PageName of the Tablix Member (group), NOT the PageName of the Tablix itselfs.
If you got the right object, if will say "Tablix Member" (Tablix-Element in German) in the title box of the properties grid. If it's the wrong object, it will say only "table/tablix" (without member).
Also, be advised to set the sort order of the group expression, so the tabs are alphabetically sorted.
If you get the tablix instead of the tablix member, it will put the same tab name in every tab, followed by a (tabNum). That is exactly your current problem.
This solution was not working for me.
I had to add group break page.
https://www.mssqltips.com/sqlservertip/3527/export-sql-server-reporting-services-report-data-into-multiple-excel-worksheets/

Use multiple ReportItems in one expression in RDLC Report

I want to display page wise sum of 2 columns in footer.for that I am using following expression in footer
=Sum(ReportItems!col1.Value) + Sum(ReportItems!col2.Value)
but it gives following error
"The Value expression for the textrun refers to more than one report item. An expression in a page header or footer can refer to only one report item."
anybody knows how can I solve this issue and display page wise sum in footer ?
Thanks
Here is simple workaround for your problem:
Add single textbox to the body of the report and name it i.e. "SUM"
Add your expression to this textbox =ReportItems!col1.Value + ReportItems!col2.Value
For this textbox set visibility as hidden
In the footer refer to this hidden textbox using =ReportItems!SUM.Value
I usually use Custom code-feature of report for these operations. Just open Report Properties and choose Code-view. Just then write basic VB get/set-methods to save and sum values.
Referring to methods in TextBox expression goes just like this: =Code.[YourMethodNameHere].
For example, saving value:
=Code.SaveMyValue(Fields!MyVal.Value)
and getting value:
=Code.GetMyValue()