Improve SSRS Report execution - sql-server

We have a SQL statement that executes in 0:07 seconds in Management Studio, its a query that returns some data like:
[Company Department] - [Exprense Type] - [Year/Month] - [Foreseen Budget] - [Expenses]
It's a 53k lines result. One calculated field is created on the dataset (Budget - Expenses).
In the SSRS report we have a matrix that shows the data like:
Columns: [Year/Month] (Group)
[Foreseen Budget] [Expenses] [Foreseen Budget - Expenses]
Lines: [Company Department][Expense Type]
When I try to generate the report I get 5 minutes in SSRS.
In the log I get :
TimeDataRetrieval:440
TimeProcessing: 8056
TimeRendering:39603
Start Time: 2016-08-24 16:40:26.030
End Time: 2016-08-24 16:41:14.220
It's like 1 minute in SSRS, which is acceptable, but in real execution the report only appears 5 minutes later.
What is happening, and how can I improve the real execution time?

What format are you rendering as? Are you viewing the rows from browser? It will take quite a bit of time for the SSRS engine to render and draw up 53K rows.
Here are a few suggestions:
You could make use of pagination - Only show a few rows at a time? Change the datasource to bring back a few rows at a time selecting from a temp table as Tyron suggested
Have you tried to use report process caching? This could help reduce the processing time
Ive described an example on this post:
SSRS with custom paging

As some suggestions came, I got that the problem was the total lines and then group then by date.
So I made a sollution in 2 steps:
1. I made a temptable with all the results
2. I worked in summarize the data in the table not in SSRS
Doing that I got a 1 minute report rendering.
Thanks folks for the help!

Related

SQL Report Builder: MIN date not pulling true MIN, somehow using a WHERE clause equivalent

In Report Builder 3.0, there's a report that I am rebuilding (this 'old' report is being fed from old DB, I am rebuilding report using data from new DB). The old report appears to somehow be using a WHERE clause equivalent, but I can't figure out how it's working. Here's the basic structure...At the bottom is the tablix that lists multiple rows ([DueDt1]) and the MIN function above is pulling the MIN date, but it is pulling the MIN date only for the rows where the [Total Still Due] is > 0.
(nothing more than a MIN, if anyone was curious)
So to see the actual results, this first shot here shows the supposed "MIN" date of 7/27/2019:
However, the real MIN date is actually 6/21/2019. It's clearly only fetching the MIN date as it pertains to some kind of WHERE clause equivalent (I say equivalent because I know there's no WHERE option in SQL Report Builder) that's filtering to only look at rows with the [Total Still Due] being > 0.
Here's the thing: this is what I want my new report to do, but when I attempt to use a MIN date function, it pulls the "real" MIN date. So how is this old report effectively using a WHERE equivalent? There is only one dataset that the old report is using, and only one dataset that my new report is using. Somehow, the old report has some kind of WHERE clause equivalent and I have no idea where or what it is. Any ideas as to how this is occurring?

SQL Report Builder 3.0 - How to group to get results (screenshots)

Here is the result set I want to get (from old report): Customer parameter is set to select all, in case anyone had questions about that field.
.....
As you can see, the report works so that each customer is grouped under a given salesperson and a total tally is at the bottom.
My problem is that this is the result I keep getting when trying to replicate this result in my new report (values aside, I know I can clean those up in the properties):
How do I do the grouping so that my subtotals, per customer, are reflected in a grand total at the bottom (in yellow)? I can do this easily in SQL, but getting it to work in report builder is what's driving me nuts lol

Total of minutes in SSRS

I am creating a report in SSRS that shows the duration of phone calls.
In my T-SQL script I am using:
CONVERT(VARCHAR,DATEADD(second,Call,0),108)AS[Call Duration]
which works nicely and shows the time as 00:03:20, for example.
However when I create a table in SSRS and try to sum all the different time values it just says #error in the report. I need the report to be able to add these time values up so I can give a total per switchboard operator. So for example if officer x took three calls and they all lasted 3 minutes then I'd need the total to say 00:09:00
Do you know of a way where I can display the total time spend rather than having to list each value separately? I can sum up the number of seconds for each call - so for example get a total of 540 seconds - but need to show this as hh:mm:ss
Thanks
The report is throwing an error because you are trying to sum up a varchar value. Rather than trying to format your data in your SQL query, simply return the values in their raw form to your SSRS report and let your presentation layer format the data for you.
Rather than using a dateadd, it seems your call length is already held within your Call column? If that is the case, simply return that column to your report, either as detail rows to be summed if the detail is required elsewhere in your report, or pre-aggregated in your SQL as this will perform better.
You can then format your Call Duration as follows:
=format(today().AddSeconds(Fields!Call.Value),"HH:mm:ss")
If you aren't aggregating your call seconds in your SQL query, you will need to do this in your expression:
=format(today().AddSeconds(sum(Fields!Call.Value)),"HH:mm:ss")
Obviously this method assumes you won't have any calls longer than 24 hours. If that is a possibility, you will need to calculate the hours, minutes and seconds to be concatenated together.

SSAS cube and getting data with MDX for SSRS report

I'm new to OLAP cubes. Can you directed in the right direction with small example.
Let's say I have table "transactions" with 3 columns: transaction_id (int), date (datetime), amount (decimal(16,2)).
I want to create a cube and then get data with MDX query for SSRS report.
I want report to show something like:
Ok. I know i can have fact table with amount and date dimention (date->month->year).
Can you explain what to do in order to get this result (including how to write MDX query). Thanks.
Can someone explain why I get amount of full 201504 and 201606 months even if I specified exact range with days?
SELECT
[Measures].[Amount] ON COLUMNS
,[Dim_Date].[Hierarchy].[Month].MEMBERS ON ROWS
FROM
[DM]
WHERE
(
{[Dim_Date].[Date Int].&[20150414] : [Dim_Date].[Date Int].&[20160615]}
)
Something like below, change the query accordingly :)
SELECT
{ [Date].[EnglishMonthName].[EnglishMonthName]} ON COLUMNS,
{ [Date].[DateHierarchy].[Year].&[2015],
[Date].[DateHierarchy].[Year].&[2016] } ON ROWS
FROM [YourCubeName]
WHERE ([Measures].[amount])
So you want someone to show you how to create a multi-dimensional cube from scratch and report on it in a single answer...? Start here and work through the lessons

Data Collection Report

I Use DataCollection on SSMA\Object Explorer\Management\DataCollection in 2 day ago.
But each time I get report from Data Collection, no data available to display. The following image is a sample Server Activity History report of data collection reports.
this query will confirm if a snapshot was actually taken on that date: (change the name of your Data Management Warehouse)
SELECT [snapshot_time_id]
,[snapshot_time]
FROM [DATA_MANAGEMENT_WAREHOUSE].[core].[snapshot_timetable_internal]
WHERE CAST(snapshot_time AS DATE) = CAST('2014-06-19' AS DATE)
if there is no result set, run without the filter to confirm when the snapshots first started and what the interval is.
SELECT [snapshot_time_id]
,[snapshot_time]
FROM [DATA_MANAGEMENT_WAREHOUSE].[core].[snapshot_timetable_internal]
Then, if you have no results, check to see if the Agent service is on. I believe it could be related to one of these things.
EDIT: added another query to check for wait stats.
SELECT [wait_type]
,[waiting_tasks_count]
,[wait_time_ms]
,[signal_wait_time_ms]
,[collection_time]
,[snapshot_id]
FROM [DATA_MANAGEMENT_WAREHOUSE].[snapshots].[os_wait_stats]

Resources