SQL Server Report Builder - Only Display Running Total - reporting-services

I have a table in Report Builder that holds how many customers were served in a specific Program by specific Branch.
Branch -> Program -> Customers Served
I keep a running total of this but that is all that I need to be displayed, not the total for every record. Any thoughts?

It's not too clear what is required - have you looked at the RunningValue function, i.e. something like?
=RunningValue(Fields!CustomersServed.Value, Sum, Nothing)
Any more information such as an example dataset and what results you'd like to see would be most helpful.

Related

Selecting multiple parameters for a report, how to create multiple pages per item in parameter list?

I have a report that is a form per order number selected prior to running report. I want to make it so that you can select multiple order_nos from a list (populated by a query that runs first). Right now, it throws an error saying ANY or ALL must be used. I think it is trying to use both order_nos as the parameter for the report. I want it to create the report using just one of the order_nos at a time, and just replicate the report several times. Is this possible?
The attached photo shows what I tried to do and the error thrown.
Error
If you want to create completely separate outputs then you will need to do this by creating a data driven subscription for your report.
The subscription will execute your report iteratively for each record produced in a preset master query that you create.
Each record in your master query should return all the order no's you wish to execute the report for.
However, if the report needs to remain interactive, and the order no's is only decided at runtime. Then i suggest you keep your report as is. Put a grouping on your tablix based on order no then apply a page break per group instance.
This will produce a single report output with each order no appearing on a different page.
As said above if you want a completely separate output (multiple excel/pdf file outputs) then you will need to use a data driven subscription.
If you need detailed steps on how to do either of the above then just let me know here and i can include steps.

SSRS - reaching outside of a group, using a variable from within the group

I have a dataset that includes details of who is providing certain services. I've been asked to provide a report that splits out how many cases each provider is working on (and the assets involved). So far so good, I've got a report that is grouped by provider and sums the assets and counts the number of cases.
Now I've been asked to add in how many cases they are working as an advisor on. The cases where they are advisor will not be cases that they are working on, so I'm a little stumped on how to pull that information into the table.
All I need to do is add something like:
=sum(iif(Fields!Advisor.value = Fields!Provider.value,1,0),"DataSet1")
but the issue is that I need the Fields!Advisor to be looking at the whole dataset, and the Fields!Provider to use the current provider within the group.
I tried using ReportItems!Textbox.value to refer to the cell that contains the name of the provider, as follows:
=sum(iif(Fields!Advisor.value = ReportItems!Textbox10.value,1,0),"DataSet1")
but it gives an error that I can't use an aggregate function over a ReportItem. I don't want to use the aggregate function over the report item - I want to treat it as a constant!
Any ideas?

Creating snapshot reports when subreports require parameters?

My situation is this - I'm using SSRS to create a "cascading" report set. The top-level report pulls all of the data from a table that capture our deployment/release activity. This data includes the property that executed a release, the organization to which that property belongs, the scheduled and actual start and end times of the release (and its constituent deployments), etc., etc., etc., and in the report I aggregate the data by time windows (Fiscal Year, then Quarter, then Month). So, at the top level, the user sees a report that shows how many deployments and releases we executed, how long they were expected to take, and how long they actually took, over the last twelve months, grouped, again, by Fiscal Year, then Quarter, than Month.
Now, the next level of detail the user wants to see is for a given month. When he or she clicks on the link to run that particular sub-report, they now get the same information (number of deployment, number of releases, scheduled and actual durations, etc.) grouped by organization, for that particular month.
Here's my dilemma - the initial report takes a LONG time to render. I would like to create snapshot report to reduce this render time, but my sub-report uses the Month from the top-level report as a parameter. In other words, when I click on the link to the sub-report, the Action setting in SSRS says to use the Month that I clicked on as a parameter to generate the sub-report, and the query in the sub-report filters off of that parameter with the following query condition:
AND FiscalQuarter IN (#Quarter)
So, the reporting works fine, but I am wondering - is there some way that I can get ALL of the data, for ALL quarters, into the sub-report in a snapshot report, and then just generate that snapshot but filtered out for the quarter value that I pass from the top-level report as a parameter?
yes you can, by creating a snapshot for sub report for all values.
and the parameter defined on the subreport should be a dataset filter not a query parameter .
Now when you pass parameter from main report to subreport , it will filter it accordingly on the sub report snapshot without having to execute the costly sql
Alas, reporting services does not provide what you need. Caching reports will create a cached version of the report per distinct combination of parameter values, and a similar situation holds for cached datasets.
You have roughly two options left it seems:
Use a cached dataset, have the subreport use the cached dataset but only use the parameter to filter the data once it's retrieved (e.g. in a tablix)
Resort to a more database-oriented caching-like or performance enhancing strategy such as for example indexed views for your queries

Totaling Expression from group header in SSRS

I'm trying to check our compliance with standards for documenting patient information, using SSRS 2008 R2. For example, in the group header for PatientID, I have =Not IsNothing(Fields!DATEOFBIRTH.Value). Now, I'd like to count the number of patients for which that returns True. The obvious way is
=Sum(Iif(Not IsNothing(Fields!DATEOFBIRTH.Value)
, 1
, 0
)
)
(which actually doesn't work, because I have multiple lines per patient, but never mind that for the moment.) The problem is that if I find my logic was wrong, I have to make the correction in two places, and it won't be obvious if I forget. In Crystal, I'd either use a running tally, evaluating on the change of group, or a manual tally with WhilePrintingRecords;, having a formula returning the T/F result in both locations. What's the generally-accepted SSRS way to do this? Thanks.
If you want to centralize logic, you can either use custom code in a report or create a custom assembly. With custom code, you'd have to update every report that uses that same logic if you find you need to make change, but it's simple to add to a report. With a custom assembly, you have to create a class library, compile it and add the code to your machine so BIDS can use it (and to every developer's machine if applicable) and to the report server. The advantage with the custom assembly is that there is one place to store the logic (not counting the distribution of the DLL) so every report gets updated automatically when you update the logic. This link is a starting point for you and provides links to more details on both of these options: http://msdn.microsoft.com/en-us/library/ms155798(v=sql.100).aspx.

MS reporting services limiting number of rows

I have a report working well where I extract the number of logins per user. Each login takes up one row on the report.
I have date parameters and my DB goes back a year. However it seems the report will only show 40/50 rows despite a report expecting to deliver, say, 250 for the amount of times I logged in.
Is there some setting in reporting services that limits the number of rows delivered. Can't find it anywhere..
Thanks.
The answer to your question: nope, as far as I know there's no real equivalent of SQL's TOP 50 statement in SSRS itself.
Some things that come to mind that may be causing your symptoms / can be investigated:
What happens if you run the query for the dataset in SSMS? Be sure to fill in the exact parameters the report's using (if any).
Run the query as a test from SSRS designer. If you're using Visual Studio: right-click the dataset and hit "Query...", then hit the red exclamation mark and fill in any parameters if needed.
Try putting a CountDistinct call (on your dataset) in a textbox somehwere in the report, by itself.
Check the filtering and grouping on your tablixes, perhaps even by looking at the XML source code for the RDL.
Show the parameters in textboxes (oldskool printf debugging! :D) to make sure they're what you expect them to be when the report's run on the Report Server. If they're not: try deleting the report on the server and re-deploying it.
Have a look at the ExecutionLog2 View in the ReportServer database, specifically the Number of Rows returned.
As mentioned in the comments by Atilla: You may also monitor exact SQL SSRS sends to server using SQL Server Profiler.