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.
Related
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.
I'm trying to build a simple report using SSAS Tabular model as datasource. There are two different dimensions in the model - UserGroups that should be used as first parameter and Regions as second one. These dimensions are M2M-related in the model. Simple measure calculated with the usage of M2M tricks for tabular models works fine in Excel and PBID.
I need those parameters to be cascaded in SSRS report. I.e. Regions dropdown should be filtered after selecting one ore more (Allow multiple values parameter option is ON) values in UserGroups dropdown.
After I put both dimension onto Filter pane in Query Designer I receive two parameters with hidden datasets. Everything looks fine but first parameters (UserGroups) actually do not filter Regions dropdown.
I think I understand the nature of the issue. We see the same picture in other client tools like Excel when placing M2M-related dimensions on the same rows/columns pane - second dimension displays in the Pivot Table all its members until we check a measure in Pivot Table Fields. All the members for the second dimension (Regions in my case) are vanished as soon as a measure comes into play - Excel is smart enough to wipe out dimension members if the measure value is null. But this does not happen in SSRS.
All the "automatic" cascading parameters creation works well within hierarchies of a single dimension. I hope this works as well with one-to-many related dimensions. But how can I extend/modify automagically-created MDX query for the second parameter dataset to be filtered out? It looks like SELECT ( StrToSet ( #[UserGroupsUserGroups], CONSTRAINED ) ) ON COLUMNS is not enough in this case. I need also to check measure value to filter out Regions list. Unfortunately I'm not an MDX expert. Please help me to inject this checking into the query.
You're on the right track and gave a good explanation of the scenario. As you found out, there is no automatic way to make the parameters cascade. You do need to add an MDX filter to the second parameter to make this happen.
As far as the actual query is concerned, there's not quite enough information to give you an exact query. But you would use StrToSet to pass in the first parameter and use the FILTER function to limit the scope. As you stated, including a measure is one way to get only the "NonEmpty" combinations of the two parameters. If you run into a specific problem with a sample query, feel free to provide more details on that.
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.
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.)
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.