Ssrs tablix filtering - reporting-services

I have filtering implemented at tablix level in an ssrs report.
The tablix is using a dataset which is getting lots of records from database using a stored procedure.
The report has parameters whose values are used to filter the tablix data.
First time when the report executes it gets all the data from stored procedure and bind it to tablix with all the details as parameters default value is set to select all.
I want to know when user enters parameter values and click on view report , does the report executes the procedure again , get the entire set of data and then filter based on input parameters?
Or the ssrs report is smart enough to know that already the data which was fetched the first time will be used to filter the data in the tablix

First let's talk about the difference between query parameters and report filters. Parameters are passed into the query so that it can run faster and return targeted results. Filters are applied after the fact so the full query has to run and then the report has to go through the records and check criteria row-by-row.
In addition to those options, SSRS offers caching. This allows you to save the query results so that the query is only re-run when needed. This is configured on the report server, not in the report properties.
The best optimization will vary by report. As a general rule it's best to pass parameters into the query/procedure and just get the data you need. If that is too slow, let the query get all the data, cache it, and just use filters at the report level.

Related

How to pass a record from ssrs main report dataset to subreport

I have a customer dataset from a main report which I bind to a list. In this list I have a subreport. How do I pass the each row of data to the subreport? I don't want to pass an id from main report to subreport then call a stored procedure to fetch the record based on the id. I already have all the details flattened out in the dataset which i fetched from the main report.
The fact is that you can't pass a set of rows as a parameter to a subreport. The most common approach is to have a shared dataset so you can execute it again based on the same parameters or a store procedure for exactly the same purpose. Only other thing can be done, and it's to convert a dataset's field into a string containing all the values, and then split it again. This is done with SSRS built-in functions join and split (if I'm not wrong), but to be honest I don't know if that solves your problem and it's a really nightmare to get it working properly.
My standard approach is to have efficient stored procedures that can be executed any times within a set of SSRS reports. I understand that you want to retrieve each datataset only once, but SSRS is not meant to make that easy.
And even more important, if you queries or procedures are efficient, data retrieval time is just a tiny porting of all SSRS report build and presentation time. Usually rendering the report is what takes longer and some repeated data extraction won't be noticed in the overall execution.
If you what to be really efficient in data retrieving, you can explore the options provided to cache data in datasets, but stills seems to be too complex to solve something that doesn't really need a solution.
Hope this helps.

SSRS - Delay Dataset queries

So, I have my report written and all is well. However now I have deployed to my live environment I have a problem; when the report is initially opened it runs all the dataset queries, as I have a large database the report is taking an age to display.
Is there a way to prevent all queries running when the report is initially opened? Would like to run just a single dataset query the populates my first parameter, so the user can begin to filter the data before selecting "View Report" to run the main dataset query with the parameters applied rather than getting everything the instant the report is opened?
I have tried setting default values in the parameters to reduce the initial data load but this seems to have confused the users, so think a blank report with nothing selected in the parameters to start with would be better.
Thanks
FTD
I assume you have some form of following.
QueryLookupState -- Used to fill dropdownlist etc.
QueryLookupCity -- Used to fill dropdownlist etc.
QueryMain , your main query which uses parameters from above.
You gave default parameters to your report therefore SSRS is using that defaults and running your main query to generate report. Change your main query and default parameters so that your main query bring empty result or main query needs parameters from lookups.
You can look following question and answer for same problem. You need at least one non-default parameter, otherwise SSRS will execute your report when it first opened.

SSRS - filter existing dataset

I have a report that uses parameters. The default parameters are defaulted to contain all available values, so by default the report the contains all possible data.
I want the user to then be able to deselect some of the values in the parameters, and to refresh the charts in the report, so they can drill down to the data that interests them.
But each time the report is refreshed, it runs the query again, slowing down the process.
Is there a way to allow the user to filter the data in the charts, without re-running the query?
I did find this, but it seems that he also didn't get a solution, or I didn't understand how the solution would work.
http://social.msdn.microsoft.com/Forums/en-US/0f905bdb-b8f2-4d9d-ac5b-e85d2f94f0cf/textbox-action-to-filter-existing-dataset-rather-than-rerun-query
To keep the query from running again, two high level steps must happen:
1) Make sure that your filters(parameters) are not included in the query. The query needs to be identical, no matter what the user has selected for a filter. This is done by moving the filters into the report. You can set them up as the filter on the tablix or on the row groups that are displaying the data.
2) Set up caching for the dataset. The easiest way to do this is by pulling the data set out of the report and create a "Shared Dataset." when you upload that to SSRS, define the dataset caching: maybe set it to last an hour. Connect the report to the shared dataset as well.
The full details of this can fill an article, such as http://www.mssqltips.com/sqlservertip/1919/how-to-enable-caching-in-sql-server-reporting-services-ssrs/ (for an old version of SSRS, but these concepts haven't changed much.)

How to use parameters in report when using SSRS matrix and table wizard

I would like my users to be able to create their own quick and easy reports from a cube on the fly, and that is most simply done using the "Table or Matrix Wizard" in Report Builder.
However they need to filter by date--and it wont work.
I have tried:
1) Creating a dataset with parameters imbedded. When you run the report, it asks for a parameter but there are no values in the drop down -- and an analysis of the "Parameter Properties" shows no available values. (Even though I chose values when creating the dataset)
2)Creating two datasets, one with all the data and one with only the date field. However the matrix wizard will not allow you to use 2 datasets.
Is there any simple way to add a filter to the report so that my users can just load a dataset/two and then use the Matrix wizard?
Thank you!
If the user running the report needs to define a date parameter, they need to create a date parameter with the same name as the parameter in the stored procedure that is called by the report. They should then set the Data Type to Date/Time, and make sure the parameter is visible.
When the user runs the report, they will be able to use the calendar feature to pass the date value to the report procedure.

How to pass parameters to report model in Reporting Services

I'm developing report in RS that show top N customers based on some criteria. It also allows to select number of customers and period of time.
Is it possible to do it by using report model? Thing that it seems to be difficult is how to pass parameters determined by user.
Another thing that in my oppinion is very disappointing is that i cannot use SQL query as dataset query, because it uses odd and elaborate XML. Although report model items seem to map its fields to query or table fields.
I m concerning using report models because i need to provide uniform data model (the same tables and fields) for more or less different database schemas.
It would be very nice if somebody would explain what can be done with report models and what can not.
Maybe what you're looking for is to use the result of a Stored Procedure as the data source for your report. You would need to define parameters at a Dataset level to pass to the SP
You can create report model based paramaterized filters through the query designer by adding a filter, drag the field you want to filter on into the filter area, then right click on it and select "Prompt". This will automatically create a report parameter which you can then edit via the parameter properties dialog to set the data type, allow multiple values, etc.