SSRS Variable Help

Hello,

I’m new to the community, Epicor and SSRS - an old Sage/Crystal veteran…

I’m diving into SSRS (report builder 3.0) reporting with Epicor 10 (10.1.400). In Crystal it was easy to name/store/fetch variables. I’m at a loss in SSRS how to name a variable.

Here is what I’m doing:

Labor Burden Actual to Budget report.
I built a BAQ with all the data - everything pulls into SSRS and displays
I need to use a number for the YTD Sales - I have that number on the report and it calculates correctly.
I need to store that number, use it in a calculation in the details of each line on the Tablix
I attempted to declare/name the variable in Report Properties | Variables - I don’t understand this area - I’m missing something simple but I have no clue what.

Here is my attempt: (I have tried several different flavors of this too with no success)

This pops an error when I try to run the report:

The Variable(vSalesYTD) expression for the report ‘body’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset.

Any suggestions would be great! Also, any suggestions on training classes that focus on more advanced formatting etc would be great too! I have exhausted my google searches… :slight_smile:

Thank you so much!
EL

** I found a solution but I’m still looking for resources on formatting…
I needed to use the dataset name :woman_facepalming:

=abs(sum(Fields!Calculated_Sales.value, “BAQReportResult”))

This link is helpful to explain the Data Scope and Hierarchy - Expression Scope for Totals, Aggregates, and Built-in Collections - SQL Server Reporting Services (SSRS) | Microsoft Docs

1 Like

I glanced at LinkedIn Learning for anything interesting, but there was not a whole lot there either as far as ‘advanced / formatting’ goes.

From my experience so far, three of the more peculiar things I have seen:

  • using a hidden expression in the body in order to set and show data in the page header or footer, which by design you cannot do except in aggregate.
  • overlaying of Rectangles with hidden expressions such that you have alternate output in the same space; because you can only edit the layout by changing background color / “sending to front” type of thing.
  • making objects hold position by using other empty objects nearby.

Thank you! Great information! I will keep breaking this report - learning as I go :slight_smile: